Saturday, December 31, 2011
Remembering my memories of 2011
Just 5 hours to go, for a beautiful New Year with new thoughts and new ideas, And I am remembering my beautiful 2011 by watching the football match between MAT UTD Vs BLACKB'N. It was a more a Happy year than a sad year.
Personal Life:
First I will start with my personal life, This year I got married to Asima and started the most challenging part of life. And also enjoying staying together the whole family. Got to know some responsibility towards a family and towards a girl. Happy to be a Son-In-Law, a different feelings.
Professional Life:
Got a very good job and a very good team to work on, which is also a part of my aim (to work
Personal Life:
First I will start with my personal life, This year I got married to Asima and started the most challenging part of life. And also enjoying staying together the whole family. Got to know some responsibility towards a family and towards a girl. Happy to be a Son-In-Law, a different feelings.
Professional Life:
Got a very good job and a very good team to work on, which is also a part of my aim (to work
Thursday, December 29, 2011
Google Adsense alternatives
First of all I will recommend you to go for Google Adsense if you have a active Adsense account. If you are banned from Google adsense then you can try out from the following google adsense alternatives. You can also check some blogger articles here.
Here are some best google adsense alternatives.
AdBrite:
AdBrite is one of the best adsense alternatives.
They have different ad formats like Full Page Ad, CPM Banners, CPC Banners, CPC Text - Banners (Content Ads), CPC Text - Inline (Key Word Contextual Targeting), Video In-Banner, Video Pre-Roll etc.
It pays with minimum $20.
Also you can run AdBrite ads with Google Adsense.
Here are some best google adsense alternatives.
AdBrite:
AdBrite is one of the best adsense alternatives.
They have different ad formats like Full Page Ad, CPM Banners, CPC Banners, CPC Text - Banners (Content Ads), CPC Text - Inline (Key Word Contextual Targeting), Video In-Banner, Video Pre-Roll etc.
It pays with minimum $20.
Also you can run AdBrite ads with Google Adsense.
Monday, December 26, 2011
List Throttling in SharePoint 2010
List Throttling is the new concepts introduced in SharePoint 2010 to set the limits on the rows of data can be retrieved from a SharePoint list or document library at one time. Suppose a SharePoint lists contains two thousand records and someone trying to retrieve all items, then List throttling will not allow to do so.
Throttling setting will be apply for both views created by the user also for queries executed in custom code also. When executing queries, the number of results returned will be determined by the throttle settings for the given list and the rights of the current user.
Throttling setting will be apply for both views created by the user also for queries executed in custom code also. When executing queries, the number of results returned will be determined by the throttle settings for the given list and the rights of the current user.
Saturday, December 24, 2011
Thursday, December 22, 2011
Why use Visual Studio in SharePoint?
If you can do things using SharePoint designer or by using browser then why should we use Visual studio?
Also you can check out some posts on:
- Deploy custom images to SharePoint 2010
- Hide ribbon in sharepoint 2010
- Content databases are growing too large in SharePoint 2013
By using Visual studio you can do very powerful things like:
You can use different built in templates available in Visual Studio 2010 to develop SharePoint things like visual web part, site definition, content types etc. Visual Studio 2010 has more templates that Visual Studio 2008.
Also it has F5 feature to build, deploy and debug like normal asp.net application.
- You can edit and debug things in your development machine which is not possible using SharePoint designer.
- You can write code using C#.net or VB.Net.
- Visual studio creates the wsp packages which are easy to deploy and also can be reused. Also you can use it in different server farm etc.
- Also you can put everything in the source control like VSS or SVN and can check-in and check-out and do work simultaneously.
- You also can have a build server if you have a very big project.
- Also one more major thing you can do: you can do code analysis, which you can not do in SharePoint designer.
- Also by using Visual Studio 2010 you can develop Sandboxed solution. Which allowed us to deploy code, even allows to upload the wsp to the solution store of the current web site without affecting other site collection on you SharePoint site.
- This is very much helpful in hosted environments.
- Visual Studio also provides Mapped Folder concept, so that everything will be placed in the proper location in the 14 hive folder.
Also you can check out some posts on:
- Deploy custom images to SharePoint 2010
- Hide ribbon in sharepoint 2010
- Content databases are growing too large in SharePoint 2013
By using Visual studio you can do very powerful things like:
You can use different built in templates available in Visual Studio 2010 to develop SharePoint things like visual web part, site definition, content types etc. Visual Studio 2010 has more templates that Visual Studio 2008.
Also it has F5 feature to build, deploy and debug like normal asp.net application.
- You can edit and debug things in your development machine which is not possible using SharePoint designer.
- You can write code using C#.net or VB.Net.
- Visual studio creates the wsp packages which are easy to deploy and also can be reused. Also you can use it in different server farm etc.
- Also you can put everything in the source control like VSS or SVN and can check-in and check-out and do work simultaneously.
- You also can have a build server if you have a very big project.
- Also one more major thing you can do: you can do code analysis, which you can not do in SharePoint designer.
- Also by using Visual Studio 2010 you can develop Sandboxed solution. Which allowed us to deploy code, even allows to upload the wsp to the solution store of the current web site without affecting other site collection on you SharePoint site.
- This is very much helpful in hosted environments.
- Visual Studio also provides Mapped Folder concept, so that everything will be placed in the proper location in the 14 hive folder.
Tuesday, December 20, 2011
SharePoint 2010 Centered Fixed Width Design
Now a days most of the web sites comes with the centred width fixed design. Means it has center fixed and some space from left side as well as from the right hand side as shown in the figure below.
But by default SharePoint design covers the full page.
I got a solution that solved my problem as well as it has advantages that the sharepoint site will be fixed design but the ribbon will cover the full page.
So here there are few modification needed in the css file as well as in the master page.
So first go and create a .css file using SharePoint designer and the paste the below content to the css file.
But by default SharePoint design covers the full page.
I got a solution that solved my problem as well as it has advantages that the sharepoint site will be fixed design but the ribbon will cover the full page.
So here there are few modification needed in the css file as well as in the master page.
So first go and create a .css file using SharePoint designer and the paste the below content to the css file.
Saturday, December 17, 2011
AllowUnsafeUpdates in SharePoint 2010
Here we will discuss about What is AllowUnsafeUpdates in SharePoint 2010?
Also check out:
- Get all security group names using SharePoint object model
- Get icon for different file types in SharePoint 2010
- Twitter SharePoint webpart
According to msdn The AllowUnsafeUpdates property of the SPWeb class gets or sets a Boolean value that specifies whether to allow updates to the database as a result of a GET request or without requiring a security validation.
If you set it to true, then it will update values to the content database but there is a security risk.
It always took boolean values, TRUE means unsafe updates are allowed, FALSE means unsafe updates are not allowed.
If you are developing a webpage that will respond to HTTP GET requests, or a custom web form page that doesn’t inherit from the WebPartPage type and doesn’t use the Form Digest control, you will need to instruct SharePoint to skip the digest validation; otherwise, your code will not work.
For example if you want to change a list's title by using object model then you have use the
AllowUnsafeUpdates property as below.
SPWeb web = SPContext.Current.Web
SPList list = web.Lists["OurCustomList"];
try
{
web.AllowUnsafeUpdates = true;
list.Title = "My List Title Changed";
list.Update();
}
finally
{
web.AllowUnsafeUpdates = false;
}
It is always advisable to revert the AllowUnsafeUpdates value to false after executing your code.
Remember if you inherit the page from WebPartPage class then no need to use AllowUnsafeUpdates.
Also check out:
- Get all security group names using SharePoint object model
- Get icon for different file types in SharePoint 2010
- Twitter SharePoint webpart
According to msdn The AllowUnsafeUpdates property of the SPWeb class gets or sets a Boolean value that specifies whether to allow updates to the database as a result of a GET request or without requiring a security validation.
If you set it to true, then it will update values to the content database but there is a security risk.
It always took boolean values, TRUE means unsafe updates are allowed, FALSE means unsafe updates are not allowed.
If you are developing a webpage that will respond to HTTP GET requests, or a custom web form page that doesn’t inherit from the WebPartPage type and doesn’t use the Form Digest control, you will need to instruct SharePoint to skip the digest validation; otherwise, your code will not work.
For example if you want to change a list's title by using object model then you have use the
AllowUnsafeUpdates property as below.
SPWeb web = SPContext.Current.Web
SPList list = web.Lists["OurCustomList"];
try
{
web.AllowUnsafeUpdates = true;
list.Title = "My List Title Changed";
list.Update();
}
finally
{
web.AllowUnsafeUpdates = false;
}
It is always advisable to revert the AllowUnsafeUpdates value to false after executing your code.
Remember if you inherit the page from WebPartPage class then no need to use AllowUnsafeUpdates.
Thursday, December 15, 2011
Implement a breadcrumb into SharePoint 2010 website
Here we will check how can we customize SharePoint 2010 breadcrumb that are available out of box.
Also you can check out:
- Customization of quick launch with flyout in sharepoint 2010
- How to add a Survey in publishing sites in SharePoint 2010?
- Make a site collection read only in SharePoint
SharePoint 2010 breadcrumb is different from MOSS 2007 breadcrumb. If you want breadcrumb like MOSS 2007 like below:
Home -> Site1 ->Site1.1 ->Site1.1.1
Default the bread crumb comes like below image.
So to full fill our requirement, open the master page that the site is using and put the below line where you want to show. It will take care of the menu part.
Also you can follow this article for similar information.
Also you can check out:
- Customization of quick launch with flyout in sharepoint 2010
- How to add a Survey in publishing sites in SharePoint 2010?
- Make a site collection read only in SharePoint
SharePoint 2010 breadcrumb is different from MOSS 2007 breadcrumb. If you want breadcrumb like MOSS 2007 like below:
Home -> Site1 ->Site1.1 ->Site1.1.1
Default the bread crumb comes like below image.
So to full fill our requirement, open the master page that the site is using and put the below line where you want to show. It will take care of the menu part.
Also you can follow this article for similar information.
Thursday, December 8, 2011
Virender Sehwag Scored 219

Virender Sehwag scored 219 in one day international. Virender Sehwag is now the highest individual scorer in One day international. He brooked Sachin's record, who scored first one day 200* against South Africa.
This is what Sehwag told to Ravi Shastri after the 1st innings.
I never expected to score a double hundred. While opening the innings, I told Gautam Gambhir that if we can show some patience on this track, we will be in for a big one as the wicket is a good one. The outfield is fantastic and the distance of the boundary is only 50 yards.
Wednesday, December 7, 2011
SharePoint 2010 Interview Questions and Answers
Before reading this, you can check SharePoint 2010 interview question and answers
Part-1 Part 2 Part 3
Q1. What is feature activation?
This is a mechanism for adding elements to a site or site collection. The elements can be menu commands, link commands, page templates, page instances, list definitions, list instances, event handlers, and workflows.
Q2. What is the difference between feature defination and feature instance?
The feature definition is the set of source files in your Visual Studio 2010 project that gets deployed using a solution package.Once deployed, a feature definition is a set of template files
Part-1 Part 2 Part 3
Q1. What is feature activation?
This is a mechanism for adding elements to a site or site collection. The elements can be menu commands, link commands, page templates, page instances, list definitions, list instances, event handlers, and workflows.
Q2. What is the difference between feature defination and feature instance?
The feature definition is the set of source files in your Visual Studio 2010 project that gets deployed using a solution package.Once deployed, a feature definition is a set of template files
Sunday, December 4, 2011
SharePoint 2010 boundaries and limits of Microsoft SharePoint Server 2010
SharePoint 2010 supports:
300 content databases per web application
250,000 site collection per web application.
10 application pools per web server.
Size of content database can be 200GB.
In case of document archive scenario there is no limit on content database size.
There can be 60 million items including documents and list items in Content database.
300 content databases per web application
250,000 site collection per web application.
10 application pools per web server.
Size of content database can be 200GB.
In case of document archive scenario there is no limit on content database size.
There can be 60 million items including documents and list items in Content database.
Get default page layout of a publishing web site in SharePoint 2010
Here we will discuss about how to Get default page layout of a publishing web site in SharePoint 2010.
Also you can check out:
- SharePoint 2010 boundaries and limits of Microsoft SharePoint Server 2010
- Delete SharePoint List using PowerShell
- Difference between SharePoint-hosted, auto-hosted and Provider-hosted apps in SharePoint 2013
Below SharePoint 2010 object model code that is used to get the default page layout of a publishing web site in SharePoint 2010. Site URL is the site collection URL.
private static void GetDefaultPageLayout()
{
using (SPSite site = new SPSite("Site URL"))
{
using (SPWeb web = site.OpenWeb())
{
// Get the publishing web site
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
PageLayout pageLayout = publishingWeb.DefaultPageLayout;
Console.WriteLine("Default Page Layout Name"+pageLayout.Name + " URL of the web site : " + pageLayout.ServerRelativeUrl);
}
}
}
Also you can check out:
- SharePoint 2010 boundaries and limits of Microsoft SharePoint Server 2010
- Delete SharePoint List using PowerShell
- Difference between SharePoint-hosted, auto-hosted and Provider-hosted apps in SharePoint 2013
Below SharePoint 2010 object model code that is used to get the default page layout of a publishing web site in SharePoint 2010. Site URL is the site collection URL.
private static void GetDefaultPageLayout()
{
using (SPSite site = new SPSite("Site URL"))
{
using (SPWeb web = site.OpenWeb())
{
// Get the publishing web site
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
PageLayout pageLayout = publishingWeb.DefaultPageLayout;
Console.WriteLine("Default Page Layout Name"+pageLayout.Name + " URL of the web site : " + pageLayout.ServerRelativeUrl);
}
}
}
SharePoint 2010 developer tool Microsoft Visual Studio 2010
Visual Studio 2010 offers lots of extensibility towards SharePoint 2010. It provides set of projects and item templates for SharePoint. Also it has deployment tools for packaging, releasing and upgrading. It provides templates for MOSS 2007 and SharePoint 2010.
Also you can check out some posts on:
- Get default page layout of a publishing web site in SharePoint 2010
- Copy or Move files from one folder to another folder using SharePoint 2010 object model
- SharePoint 2013 workflow architecture
Here are some project templates:
Empty SharePoint Project: This is the empty project and provides references to some useful libraries and also provides support for automatic deployment.
Visual WebPart: This is used to create Visual webpart in SharePoint 2010.
Sequential Workflow: This project template is used for developing sequential workflow.
State Machine Workflow: This project template is used for developing state machine workflow.
Business Data Connectivity Model: With this project template, you can develop custom entity models for connecting SharePoint with custom external data sources.
Event Receiver: This is a project template for adding an event receiver.
List Definition: This is a project type that is intended for deploying a new list definition.
Content Type: This template creates a project to deploy a new content type.
Module: With this project template, you can deploy content, such as images, pages, Web Parts, and so on into a SharePoint site.
Site Definition: This is a project intended for defining site defination.
Import Reusable Workflow: This project template is useful for importing workflows designed with SharePoint Designer 2010
Import SharePoint Solution Package: Imports an old or third-party solution package (WSP).
Also Visual Studio 2010 SharePoint developers tool provides a lot of item templates:
Visual Web Part: Define a custom visual web part
-->
Also you can check out some posts on:
- Get default page layout of a publishing web site in SharePoint 2010
- Copy or Move files from one folder to another folder using SharePoint 2010 object model
- SharePoint 2013 workflow architecture
Here are some project templates:
Empty SharePoint Project: This is the empty project and provides references to some useful libraries and also provides support for automatic deployment.
Visual WebPart: This is used to create Visual webpart in SharePoint 2010.
Sequential Workflow: This project template is used for developing sequential workflow.
State Machine Workflow: This project template is used for developing state machine workflow.
Business Data Connectivity Model: With this project template, you can develop custom entity models for connecting SharePoint with custom external data sources.
Event Receiver: This is a project template for adding an event receiver.
List Definition: This is a project type that is intended for deploying a new list definition.
Content Type: This template creates a project to deploy a new content type.
Module: With this project template, you can deploy content, such as images, pages, Web Parts, and so on into a SharePoint site.
Site Definition: This is a project intended for defining site defination.
Import Reusable Workflow: This project template is useful for importing workflows designed with SharePoint Designer 2010
Import SharePoint Solution Package: Imports an old or third-party solution package (WSP).
![]() |
| Visual-Studio-SharePoint-Project-Template |
Visual Web Part: Define a custom visual web part
WebPart: Define a code-only web part
Sequential Workflow: Declares a sequential workflow
State Machine: Declares a state machine workflow
Application Page: Creates a custom application webpage
Event Receiver: Defines an event receiver to handle events related to sites, lists, items, or workflows
Module: Supports deploying any kind of item (image, file, page, whatever) using a deployment package (WSP)
Content Type: Allows the definition of a new content type.
List Definition: Defines a list definition from scratch
List Instance: Creates an instance of a specific list definition.
Empty Element: Supports deploying any kind of feature using a deployment package (WSP)
User Control: Installs a custom user control that defines UI elements based on an .ascx file
![]() |
| Visual-Studio-SharePoint-Item-Template |
Wednesday, November 30, 2011
SQL Server tips and tricks
Here are some sql server tips and tricks.
To get all the Tables Information in SQL Server
SELECT * from SYS.Tables
To get all the views information in SQL Server
Select * from sys.views OR
To get only view names
Select Name from sys.views
To get all stored procedure names
To get all the Tables Information in SQL Server
SELECT * from SYS.Tables
To get all the views information in SQL Server
Select * from sys.views OR
To get only view names
Select Name from sys.views
To get all stored procedure names
How to export gridview data to excel in asp.net?
Here we will discuss how to export the gridview data into excel. There might be a chance that you have a lot of columns in your dataset or datatable but you want to show only those records that are showing in the gridview only. So here is the code to export gridview data to excel in asp.net.
protected void btnExport_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds = GetDataForGridView();
string attachment = attachment = "attachment; filename=MyExcelSheetName_" + DateTime.Now.ToString() + ".xls";
if (ds.Tables.Count > 0)
{
DataTable dt = ds.Tables[0];
protected void btnExport_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds = GetDataForGridView();
string attachment = attachment = "attachment; filename=MyExcelSheetName_" + DateTime.Now.ToString() + ".xls";
if (ds.Tables.Count > 0)
{
DataTable dt = ds.Tables[0];
Saturday, November 26, 2011
SharePoint Oppenings at Accenture
Requirement: SharePoint Server.
Job Description:
Very good knowledge on SharePoint basics (WSS and SPS features, Administration, Knowledge on lists and document library) and working experience on Application programming, development, configuration, deployment and maintenance (Site configuration, back up, restore and template manipulation). Should have at least 1 year of work experience on SharePoint and its related technologies. He also should have fair knowledge
Job Description:
Very good knowledge on SharePoint basics (WSS and SPS features, Administration, Knowledge on lists and document library) and working experience on Application programming, development, configuration, deployment and maintenance (Site configuration, back up, restore and template manipulation). Should have at least 1 year of work experience on SharePoint and its related technologies. He also should have fair knowledge
Monday, November 21, 2011
System.MissingMethodException: No parameterless constructor defined for this object error in custom pagelayout
In this post we will discuss how to resolve error: System.MissingMethodException: No parameterless constructor defined for this object error in custom pagelayout.
Also you can check out my previous posts on:
- Programmatically get SharePoint Themes
- Signin as different user is missing in SharePoint 2013
- Change "Add New Item" link text in list in SharePoint 2010
I got this error "System.MissingMethodException: No parameterless constructor defined for this object " while trying to add a custom web part to a custom page layout using Visual Studio 2010 in SharePoint 2010. I was getting the error when I am changing the page layout to my custom page layout.
My problem was with the 4 part assembly name that I was getting by following this link.
Actually that was giving me the wrong 4 part assembly name that I was using in my elements.xml file. So I have changed the 4 part assembly name and that worked !!! The best way to get 4 part assemble is by following this article.
Also you can check out my previous posts on:
- Programmatically get SharePoint Themes
- Signin as different user is missing in SharePoint 2013
- Change "Add New Item" link text in list in SharePoint 2010
I got this error "System.MissingMethodException: No parameterless constructor defined for this object " while trying to add a custom web part to a custom page layout using Visual Studio 2010 in SharePoint 2010. I was getting the error when I am changing the page layout to my custom page layout.
My problem was with the 4 part assembly name that I was getting by following this link.
Actually that was giving me the wrong 4 part assembly name that I was using in my elements.xml file. So I have changed the 4 part assembly name and that worked !!! The best way to get 4 part assemble is by following this article.
Friday, November 18, 2011
How to find the ID for associated content type when adding a page layout?
If you are working in SharePoint 2010 with pagelayout by using Visual Studio 2010, then while deploying the layout template you will need the content typeid. You need the id in the element.xml file in PublishingAssociatedContentType tag.
Then PublishingAssociatedContentType should be in form ';#;#. The Content type name is the name of the content type that your page layout based on. Suppose you are making a publishing pagelayout and your content type is based on Welcome Page content type. Then to get the content type id go to Site Actions -> Site Settings then from Galleries section Select Site content types. Then choose your content type from the list of content types. I am choosing her Welcome Page from Page Layout Content Types section as shown in the figure below.
Now check the URL as shown in the figure below in the ManageContentType page. Your id is after ctype= and before &Source= in the URL. You can copy that and paste in the Elements.xml file as shown below.
<Property Name="PublishingAssociatedContentType" Value=";#Welcome Page;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#" />
Then PublishingAssociatedContentType should be in form ';#
<Property Name="PublishingAssociatedContentType" Value=";#Welcome Page;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#" />
Thursday, November 17, 2011
Delete custom page layout in SharePoint 2010
Here we will discus how we can delete a custom page layout in SharePoint 2010.
Also you can check out:
- Create Page Layout using SharePoint Designer 2010
- Get default page layout of a publishing web site in SharePoint 2010
- Programmatically add or assign user to User Group in SharePoint
Sometime you will need to delete your custom page layout in SharePoint 2010. For this go to Site Actions -> Site Settings -> then under Galleries. Go to Master pages and page layouts. Then select your page layout and delete as shown in the figure below.
Also you can check out:
- Create Page Layout using SharePoint Designer 2010
- Get default page layout of a publishing web site in SharePoint 2010
- Programmatically add or assign user to User Group in SharePoint
Sometime you will need to delete your custom page layout in SharePoint 2010. For this go to Site Actions -> Site Settings -> then under Galleries. Go to Master pages and page layouts. Then select your page layout and delete as shown in the figure below.
Why does the Visual Studio editor show dots in blank spaces?
I got dots in blank spaces in my Visual Studio 2010 editor, I have tried to reset the Visual studio 2010 but that also did not help me out. When I search in google, I saw I have configured to show white space.
To resolve this you can go to Edit menu in visual studio then Advanced ->unSelect View White Spaces as shown in the figure below.
Also you can use the shotcut key Ctrl+R, Ctrl+W.
Sometimes shotcut keys are also dangerous !!!
To resolve this you can go to Edit menu in visual studio then Advanced ->unSelect View White Spaces as shown in the figure below.
Also you can use the shotcut key Ctrl+R, Ctrl+W.
Sometimes shotcut keys are also dangerous !!!
Only Content controls are allowed directly in a content page that contains Content controls in sharepoint 2010 page layout
In this post we will discuss how to resolve error: Only Content controls are allowed directly in a content page that contains Content controls in sharepoint 2010 page layout.
Also you can check out my previous posts on:
- How to Configure SSRS for SharePoint Integration Mode in SharePoint 2010?
- Call jQuery to SharePoint page using Content Editor web part
- Script editor web part in SharePoint 2013
I got the error "Only Content controls are allowed directly in a content page that contains Content controls in sharepoint 2010 page layout" while creating page layout using visual studio 2010. What I was doing is I am copying the layout page content from a layout page from SharePoint 2010 designer. so when I was coping and pasting the content, My tags are coming like below
<asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
<SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
</asp:Content>
Please look at the capital letter C in Content, which was causing the problem.
so I have changed the code to small c as below and it works fine.
<asp:content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
<SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
</asp:content>
<asp:content ContentPlaceholderID="PlaceHolderMain" runat="server">
</asp:content>
Also you can check out my previous posts on:
- How to Configure SSRS for SharePoint Integration Mode in SharePoint 2010?
- Call jQuery to SharePoint page using Content Editor web part
- Script editor web part in SharePoint 2013
I got the error "Only Content controls are allowed directly in a content page that contains Content controls in sharepoint 2010 page layout" while creating page layout using visual studio 2010. What I was doing is I am copying the layout page content from a layout page from SharePoint 2010 designer. so when I was coping and pasting the content, My tags are coming like below
<asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
<SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
</asp:Content>
Please look at the capital letter C in Content, which was causing the problem.
so I have changed the code to small c as below and it works fine.
<asp:content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
<SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
</asp:content>
<asp:content ContentPlaceholderID="PlaceHolderMain" runat="server">
</asp:content>
Monday, November 14, 2011
Get all security group names using SharePoint object model
In this post we will discuss about how to get all security group names using SharePoint object model.
Also you can check out:
- Delete custom page layout in SharePoint 2010
- Enable Sign in as Different User Option in SharePoint 2013
- SharePoint: Custom Media Video Player using JQuery
You can get the security group names using SharePoint object model by using the SPGroup class.
Here is the code below:
using (SPSite siteCollection = new SPSite("Ur Site collection URL"))
{
using(SPWeb site = siteCollection.OpenWeb)
{
foreach(SPGroup group in site.Groups)
{
string groupName=group.Name;
}
}
}
It will give you all the group names available in the current site inside the site collection. Also one thing to remember is that you can not create a Group at the site level, always you have to create in the Site collection.
The below code shows how to add a group to a site collection:
site.SiteGroups.Add("NewSecurityGroup",site.CurrentUser,site.CurrentUser,"A new group");
Also you can check out:
- Delete custom page layout in SharePoint 2010
- Enable Sign in as Different User Option in SharePoint 2013
- SharePoint: Custom Media Video Player using JQuery
You can get the security group names using SharePoint object model by using the SPGroup class.
Here is the code below:
using (SPSite siteCollection = new SPSite("Ur Site collection URL"))
{
using(SPWeb site = siteCollection.OpenWeb)
{
foreach(SPGroup group in site.Groups)
{
string groupName=group.Name;
}
}
}
It will give you all the group names available in the current site inside the site collection. Also one thing to remember is that you can not create a Group at the site level, always you have to create in the Site collection.
The below code shows how to add a group to a site collection:
site.SiteGroups.Add("NewSecurityGroup",site.CurrentUser,site.CurrentUser,"A new group");
Sunday, November 13, 2011
URL Rewritting in asp.net
Here we will discuss about URL rewriting in asp.net. Though MVC has built in facility of URL rewritting but classic asp.net does not have.
Why it is necessary?
A SEO user friendly URL is necessary for the SEO purpose.
For example:
http://www.fewlines4biju.com/Blog.aspx?BlogID=5 URL is not a SEO user friendly URL.
http://www.fewlines4biju.com/Blogs/Details/another-article-by-bijay-kumar-for-seo-5.aspx , but this URL is a SEO friendly URL. So it is always better to have a URL like the above.
So we will discuss the steps below:
First of all we will check the web.config entries, I am writting the entries with the parent tag. You have to replace your folder structure accordingly.
web.config:
Why it is necessary?
A SEO user friendly URL is necessary for the SEO purpose.
For example:
http://www.fewlines4biju.com/Blog.aspx?BlogID=5 URL is not a SEO user friendly URL.
http://www.fewlines4biju.com/Blogs/Details/another-article-by-bijay-kumar-for-seo-5.aspx , but this URL is a SEO friendly URL. So it is always better to have a URL like the above.
So we will discuss the steps below:
First of all we will check the web.config entries, I am writting the entries with the parent tag. You have to replace your folder structure accordingly.
web.config:
Unrecognized configuration section rewriter
This error occurs while implementaining URL Rewritting in asp.net by using Intelligencia.UrlRewriter.dll. Here the web.config entries are very much important.
This comes if you are using the below tag before defining the rewriter tage in.
<rewriter>
<rewrite url="~/Articles/Details/(.+)-(.+).aspx" to="~/Articles/sharepoint-article-details.aspx?ArticleID=$2"/>
</rewriter>
So your web. config entries should be like below.
<configSections>
This comes if you are using the below tag before defining the rewriter tage in
<rewriter>
<rewrite url="~/Articles/Details/(.+)-(.+).aspx" to="~/Articles/sharepoint-article-details.aspx?ArticleID=$2"/>
</rewriter>
So your web. config entries should be like below.
<configSections>
Could not load type formrewritercontroladapter
This error ususally comes when you will try to implement postback thing in URL rewritting by adding App_Browsers and putting the Form.browser inside the App_Browsers folder.
If this error comes while implementing URL rewritting then, Download the class from this URL and put it inside the App_Code folder. You can download the whole files here.
If this error comes while implementing URL rewritting then, Download the class from this URL and put it inside the App_Code folder. You can download the whole files here.
Thursday, November 10, 2011
Wednesday, November 9, 2011
How to create datatable at runtime in asp.net using c#.net?
Here is the code to create a datatable at runtime in asp.net using C#.Net.
Also you can check out some posts on:
- AllowUnsafeUpdates in SharePoint 2010
- How to Create a Content Type using Visual Studio 2010 in SharePoint 2010?
- Show SharePoint list data in repeating table in infopath 2010 using SharePoint object model
Below is the namespace needed.
using System.Data;
// Create a DataTable instance
DataTable dataTable = new DataTable("DataTableName");
// Create a DataColumn instances
DataColumn dtCol1 = new DataColumn();
DataColumn dtCol2 = new DataColumn();
dtCol1.ColumnName = "Id";
dtCol1.DataType = Type.GetType("System.Int32");
dtCol2.ColumnName = "Name";
dtCol2.DataType = Type.GetType("System.String");
// Add these DataColumns into the DataTable
dataTable.Columns.Add(dtCol1);
dataTable.Columns.Add(dtCol2);
// Create a DataRow Instance from the table we create above, with NewRow();
DataRow row = dataTable.NewRow();
row["Id"] = 1;
row["Name"] = "Fewlines4Biju";
// Add the row into the table
dataTable.Rows.Add(row);
Also you can check out some posts on:
- AllowUnsafeUpdates in SharePoint 2010
- How to Create a Content Type using Visual Studio 2010 in SharePoint 2010?
- Show SharePoint list data in repeating table in infopath 2010 using SharePoint object model
Below is the namespace needed.
using System.Data;
// Create a DataTable instance
DataTable dataTable = new DataTable("DataTableName");
// Create a DataColumn instances
DataColumn dtCol1 = new DataColumn();
DataColumn dtCol2 = new DataColumn();
dtCol1.ColumnName = "Id";
dtCol1.DataType = Type.GetType("System.Int32");
dtCol2.ColumnName = "Name";
dtCol2.DataType = Type.GetType("System.String");
// Add these DataColumns into the DataTable
dataTable.Columns.Add(dtCol1);
dataTable.Columns.Add(dtCol2);
// Create a DataRow Instance from the table we create above, with NewRow();
DataRow row = dataTable.NewRow();
row["Id"] = 1;
row["Name"] = "Fewlines4Biju";
// Add the row into the table
dataTable.Rows.Add(row);
Authentication, Authorization and Identities in SharePoint 2010
Security is very much important in a business solution. Because business needs, if a user does not have permission he should not be able to view, edit or delete sensitive pages. And also if a user has permission, he should able to visit pages, items or documents.
Authentication: It is the process of getting the identity of a user. You can authenticate people with the use of Windows account stored in Active directory. This authentication happen when a user logged in to the computer. Once authenticated we can retrieve name as below:
WindowsIdentity identity = WindowsIdentity.GetCurrent;
Authentication: It is the process of getting the identity of a user. You can authenticate people with the use of Windows account stored in Active directory. This authentication happen when a user logged in to the computer. Once authenticated we can retrieve name as below:
WindowsIdentity identity = WindowsIdentity.GetCurrent;
Tuesday, November 8, 2011
What is Performance Testing?
In Performance testing we are checking we are concentrating on speed in processing of a software by checking below factors:
Ø Execution of as s/w under customer expected configuration and customer expected load to calculate speed in processing, is called as Load Testing. Here load means number of concurrent users using our s/w.
Ø Execution of our s/w under customer expected configuration and more than customer expected load to estimate reliability is called as Stress Testing.
Ø Execution of our s/w under customer expected configuration and sudden increments of load to estimate reliability is called as Spike Testing.
Ø Execution of our s/w under customer expected configuration and continuous load long time to estimate durability is called as Endurance/Durability/ Longuity Testing.
Friday, November 4, 2011
We are blind or closed our eyes !!! Lets Support Anna Hazare !!!
The Anna Hazare, 74 year old man again raised his voice after 19 days maun vrat. He said fight for Janlokpal Bill will continue. You can check here. Hazare had threatened to launch another hunger strike if a strong Lokpal Bill is not passed in Parliament's Winter Session.
Another Team member of Anna Hazare Arvind Kejriwal returns 9 lakh dues to government
He also wrote to PM "I am enclosing a cheque for Rs 9,27,787. This does not mean that I have accepted the mistake. When I don't know what was the mistake I committed, then there is no question of accepting it. I am
Another Team member of Anna Hazare Arvind Kejriwal returns 9 lakh dues to government
He also wrote to PM "I am enclosing a cheque for Rs 9,27,787. This does not mean that I have accepted the mistake. When I don't know what was the mistake I committed, then there is no question of accepting it. I am
Wednesday, November 2, 2011
How to add read more in blogger blog?
To add Read More link in blogger blog is easy in the new advanced editor provided by google. Simple you need to click on the Insert jump break icon in the line on which you want the read more.
Write text file in UTF8 format using MemoryStream
Below is the code to write text in UTF8 format using memorystream using c#.net
Response.Clear();
MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes("This is the text you want to write in text file"));
Response.AddHeader("Content-Disposition", "attachment; filename=filename.txt");
Response.ContentType = "text/plain";
Response.ContentEncoding = System.Text.Encoding.UTF8;
memoryStream.WriteTo(Response.OutputStream);
Response.End();
Response.Clear();
MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes("This is the text you want to write in text file"));
Response.AddHeader("Content-Disposition", "attachment; filename=filename.txt");
Response.ContentType = "text/plain";
Response.ContentEncoding = System.Text.Encoding.UTF8;
memoryStream.WriteTo(Response.OutputStream);
Response.End();
Friday, October 28, 2011
Changes in UI in SharePoint 2010
General Improvements:
- Reduce use of tables in HTML
- Cross browser support-IE, Firefox, Safari.
- UI upgradtion is separate frm database upgrade.
- Client object model- Javascript and silverlight.
- CSS is splited in multiple files and downloaded what are necessary only.
- Javascript can load when u need.
- Application pages use dynamic master pages
- Always on the top of the page and fixed in that position even if u scroll the page.
Wednesday, October 26, 2011
How to Implement SQLServer authentication in asp.net?
To implement SQL Server authentication in asp.net, you have to change in web.config as well as in SQL server.
First go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 folder and execute InstallPersistSqlState.sql in the SQL Server. Just to let you know that it will create the ASPState database and the required stored procedures. Please check if you have .net 2.0 then check the corresponding folder.
Also if you do not want to create the default ASPState database then you can modify the script InstallPersistSqlState.sql and run that.
In the next step we have to modify the we.config for this. The main work is to change the session state mode, and the connection string.
If you are using windows authentication mode in SQL Server then you have to change web.config as below:
<sessionState mode="SQLServer" sqlConnectionString="Data Source=BSAHOO3SQLEXPRESS;Integrated Security=SSPI;"
cookieless="false"
timeout="60"
/>
If you are using SQL Server authentication mode then you have to change the web.config as below:
First go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 folder and execute InstallPersistSqlState.sql in the SQL Server. Just to let you know that it will create the ASPState database and the required stored procedures. Please check if you have .net 2.0 then check the corresponding folder.
Also if you do not want to create the default ASPState database then you can modify the script InstallPersistSqlState.sql and run that.
In the next step we have to modify the we.config for this. The main work is to change the session state mode, and the connection string.
If you are using windows authentication mode in SQL Server then you have to change web.config as below:
<sessionState mode="SQLServer" sqlConnectionString="Data Source=BSAHOO3SQLEXPRESS;Integrated Security=SSPI;"
cookieless="false"
timeout="60"
/>
If you are using SQL Server authentication mode then you have to change the web.config as below:
Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above
While I am trying to use sql server authentication mode, i got the following error
Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.
Cause: If your application is suppose .Net 4 then you need to take the InstallPersistSqlState.sql of the Framework64 version.
Solution: So go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 and from there take the InstallPersistSqlState.sql, it will work fine.
Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server. Please install ASP.NET Session State SQL Server version 2.0 or above.
Cause: If your application is suppose .Net 4 then you need to take the InstallPersistSqlState.sql of the Framework64 version.
Solution: So go to C:\Windows\Microsoft.NET\Framework64\v4.0.30319 and from there take the InstallPersistSqlState.sql, it will work fine.
Cannot drop database "ASPState" because it is currently in use
I got this error Cannot drop database "ASPState" because it is currently in use. while trying to uninstall ASPState database by using the UninstallPersistSqlState.sql script. Actually after install InstallPersistSqlState.sql, you can not directly uninstall the ASPState DB, so you need to run this commond (net stop w3svc) before uninstalling.
For this go to Start -> Run -> cmd and then in the command prompt type net stop w3svc as shown in the below figure. After that try to uninstall using UninstallPersistSqlState.sql.
For this go to Start -> Run -> cmd and then in the command prompt type net stop w3svc as shown in the below figure. After that try to uninstall using UninstallPersistSqlState.sql.
![]() |
| net stop w3svc |
Tuesday, October 25, 2011
Thursday, October 20, 2011
SharePoint 2010 powershell commands
Introduction:
In this article we will discuss about PowerShell commands which is introduced in SharePoint 2010. You can also visit Powershell command to install activate feature SharePoint 2010.
Description:
In MOSS2007 there was stsadm command line tool to work with MOSS2007, but in SharePoint it comes with Windows PowerShell to work with SharePoint 2010. This commadline tool will be available after SharePoint 2010 Products. The commands are know as cmdlets in powershell language.
To access power shell go to Start -> All Programs -> Microsoft SharePoint 2010 Products
In this article we will discuss about PowerShell commands which is introduced in SharePoint 2010. You can also visit Powershell command to install activate feature SharePoint 2010.
Description:
In MOSS2007 there was stsadm command line tool to work with MOSS2007, but in SharePoint it comes with Windows PowerShell to work with SharePoint 2010. This commadline tool will be available after SharePoint 2010 Products. The commands are know as cmdlets in powershell language.
To access power shell go to Start -> All Programs -> Microsoft SharePoint 2010 Products
How to close the current tab in the browser in c#.net?
For this post, I am really thankful to Mr. K.Kathiravan, for finding the solution for closing the current tab of the browser with asking any confirmation. I need to close the current tab (if only one tab open then need to close the browser) while user click on a link (take an example of log out). I also do not want any confirmation message before closing that, since our requirement is to close the browser in any case.
Here is the code that I have written in the page load and it works for me.
Response.Write("<script language='javascript'>window.open('','_self');window.close();</script>");
Here is the code that I have written in the page load and it works for me.
Response.Write("<script language='javascript'>window.open('','_self');window.close();</script>");
Wednesday, October 19, 2011
Dot net walkin bangalore
Dot net walkin both windows and web based application is conducting in bangalore. Please see the details below:
Date: Saturday, 22 Oct 2011
Experience: 2-5 years Relevant Experience
Windows Application Developers: C# & MS SQL Server
Web Application Developers: C#, ASP.net & MS SQL Server
EXPERIENCE IN WCF AND CRYSTAL REPORTS WILL BE AN ADDED ADVANTAGE
Time: 10 AM - 4 PM
Contact:
Sheorey Digital Systems Ltd.
Software Lab & Technical Support Center
41, HAL Airport Main Road
3rd Floor (Above Spencers)
73, Konena Agrahara
Bengaluru 560 017. India
Phone no: 080-25036000
Date: Saturday, 22 Oct 2011
Experience: 2-5 years Relevant Experience
Windows Application Developers: C# & MS SQL Server
Web Application Developers: C#, ASP.net & MS SQL Server
EXPERIENCE IN WCF AND CRYSTAL REPORTS WILL BE AN ADDED ADVANTAGE
Time: 10 AM - 4 PM
Contact:
Sheorey Digital Systems Ltd.
Software Lab & Technical Support Center
41, HAL Airport Main Road
3rd Floor (Above Spencers)
73, Konena Agrahara
Bengaluru 560 017. India
Phone no: 080-25036000
Tuesday, October 18, 2011
Create event receiver in Sandboxed solution is SharePoint
We can create an event receiver using visual studio 2010 in SharePoint 2010 in Sandboxed solution. That event receiver can do something like, your event receiver can add items to a list when the feature is activated.
Steps:
For this first open visual studio 2010 then go to File -> New Project then select an Empty SharePoint Project, give a proper name and click on OK. Then in the SharePoint customization wizard give the local debugging url and choose the option Deploy as a Sandboxed solution then click on Finish.
Now our empty sharepoint project is ready and we need to add a Feature. For this right click in the Features folder in the solution and Add Feature, your Feature.feature is successfully created as shown in the figure below.
Now in the next step we will add the event receiver. For this right click on Feature1 then Add Event Receiver
Steps:
For this first open visual studio 2010 then go to File -> New Project then select an Empty SharePoint Project, give a proper name and click on OK. Then in the SharePoint customization wizard give the local debugging url and choose the option Deploy as a Sandboxed solution then click on Finish.
Now our empty sharepoint project is ready and we need to add a Feature. For this right click in the Features folder in the solution and Add Feature, your Feature.feature is successfully created as shown in the figure below.
Now in the next step we will add the event receiver. For this right click on Feature1 then Add Event Receiver
Sunday, October 16, 2011
Microsoft Enterprise Library 5.0 for data access
I always prefer to use Microsoft Enterprise Library rather than classic ado.net approach. Now the latest version of Microsoft Enterprise Library is 5.0. For previous versions you can check this article.
In the very first step you have to download Microsoft Enterprise Library 5.0 from the Microsoft site. Then install the .msi file. After that you will get all the dlls from the installation directory. I am here only describing how to use Microsoft Enterprise Library for data access.
You will need the below dlls:
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.Interception.dll
You have to give all the references for the above dlls in the Bin folder. Then follow from Step 3 onwards from this URL.
In the very first step you have to download Microsoft Enterprise Library 5.0 from the Microsoft site. Then install the .msi file. After that you will get all the dlls from the installation directory. I am here only describing how to use Microsoft Enterprise Library for data access.
You will need the below dlls:
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll
Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime.dll
Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.EnterpriseLibrary.Data.SqlCe.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.Interception.dll
You have to give all the references for the above dlls in the Bin folder. Then follow from Step 3 onwards from this URL.
Friday, October 14, 2011
Customization of quick launch with flyout in sharepoint 2010
In this post we will discuss about how to do Customization of quick launch with flyout in sharepoint 2010. Thanks to Ramya Sekar for this post !!!
Also you can check out:
- Change page layout programmatically SharePoint 2010
- Enable Sign in as Different User Option in SharePoint 2013
- Introduction to SharePoint 2013 REST service
We can see the menus with flyouts option in many popular sites. In sharepoint its possible with the following steps
Step-1:
Create a site in SharePoint 2010
Step-2:
Goto SiteAction-> Edit in SharePoint Designer.Under the navigation click Master Page.Then select your master page:
Step-3:
Edit the file and go to the code of that master page
Identify the following tag
Change the value of StaticDisplayLevels to 1 and MaximumDynamicDisplayLevels to 1
Then Click save to save the changes.
Step-4:
Open the site again to see the changes.
Step-5:
We can set more pages with different heading as navigation by
Goto SiteAction -> SiteSetting
Under the Look and Feel Click quick launch
I create New Heading Requirement Details with the link Testing as follows
By this way we can create several headings with several flyouts in sharepoint site.
Also you can check out:
- Change page layout programmatically SharePoint 2010
- Enable Sign in as Different User Option in SharePoint 2013
- Introduction to SharePoint 2013 REST service
We can see the menus with flyouts option in many popular sites. In sharepoint its possible with the following steps
Step-1:
Create a site in SharePoint 2010
Step-2:
Goto SiteAction-> Edit in SharePoint Designer.Under the navigation click Master Page.Then select your master page:
Step-3:
Edit the file and go to the code of that master page
Identify the following tag
Change the value of StaticDisplayLevels to 1 and MaximumDynamicDisplayLevels to 1
Then Click save to save the changes.
Step-4:
Open the site again to see the changes.
Step-5:
We can set more pages with different heading as navigation by
Goto SiteAction -> SiteSetting
Under the Look and Feel Click quick launch
I create New Heading Requirement Details with the link Testing as follows
By this way we can create several headings with several flyouts in sharepoint site.
Java openings for experienced professionals in bangalore
Java J2ee with Spring Hibernate walkin.
Java J2ee with Struts Walkin. All the walkins are for 3.5 years to 5.5 years.
For java openings please check the image below. Job description, job location and experience details all are present. This is a direct walkin and you have to put my employee id: 112971 and Name: Bijaya kumar Sahoo.
Java J2ee with Struts Walkin. All the walkins are for 3.5 years to 5.5 years.
For java openings please check the image below. Job description, job location and experience details all are present. This is a direct walkin and you have to put my employee id: 112971 and Name: Bijaya kumar Sahoo.
Tuesday, October 11, 2011
JavaScript validation for AJAX HTML editor
As I told before I am very weak in JavaScript, still I am trying to do some validation using JavaScript. Here in this example I am using JavaScript to check wether AJAX html editor is empty or not. If it is empty, it will show content can not be empty. In my project I have a master page, but I am putting the validation in a different page.
The Javascript function I have written inside
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script language="javascript" type="text/javascript">
function validateposting() {
var strtitle = document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").value;
var a = $find("<%=Editor1.ClientID%>");
var value = a.get_content();
if (document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").value == "") {
document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").focus();
alert('Title is required');
return false;
}
if (value == "") {
alert('Content is required');
return false;
}
}
</script>
The Javascript function I have written inside
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<script language="javascript" type="text/javascript">
function validateposting() {
var strtitle = document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").value;
var a = $find("<%=Editor1.ClientID%>");
var value = a.get_content();
if (document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").value == "") {
document.getElementById("ctl00_ContentPlaceHolder1_txtTitle").focus();
alert('Title is required');
return false;
}
if (value == "") {
alert('Content is required');
return false;
}
}
</script>
Wednesday, October 5, 2011
Disable browser back button
I got a schenario where after log out, I do not want any one to come out to my page. You simply need to write the code below the <head> tag
<script type="text/javascript" language="javascript">
javascript:window.history.forward(1);
</script>
<script type="text/javascript" language="javascript">
javascript:window.history.forward(1);
</script>
Tuesday, October 4, 2011
Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack
I got the error "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack" in a Response.Redirect(" http://www.sharepointdotnet.com/ "). My code is in try catch block as below.
try
{
Response.Redirect("http://www.sharepointdotnet.com/ ");
}
catch (Exception ex)
{
//I am getting the exception here.
}
Cause:
Because Response.Redirect("Ur URL") usually internally calls the Response.End() and this internally calls the Thread.Abort() which internally tells the stack to end the thread.
Resolve:
try
{
Response.Redirect("http://www.sharepointdotnet.com/ ");
}
catch (Exception ex)
{
//I am getting the exception here.
}
Cause:
Because Response.Redirect("Ur URL") usually internally calls the Response.End() and this internally calls the Thread.Abort() which internally tells the stack to end the thread.
Resolve:
Thursday, September 29, 2011
Date validation using JavaScript
Just to tell you every one I am too bad at javascript !!!
Here is a date validation through javascript that will give an alert message if you try to give a date less than today. It will always take the future date
var expDate = document.getElementById('txtDate').value;
var date = expDate.substring(0, 2);
var month = expDate.substring(3, 5);
var year = expDate.substring(6, 10);
var myDate = new Date(year, month - 1, date);
var today = new Date();
if (myDate > today) {
}
else {
alert('Please enter a date greater than today !');
return false;
}
Here is a date validation through javascript that will give an alert message if you try to give a date less than today. It will always take the future date
var expDate = document.getElementById('txtDate').value;
var date = expDate.substring(0, 2);
var month = expDate.substring(3, 5);
var year = expDate.substring(6, 10);
var myDate = new Date(year, month - 1, date);
var today = new Date();
if (myDate > today) {
}
else {
alert('Please enter a date greater than today !');
return false;
}
Friday, September 23, 2011
Connected web part in SharePoint 2010 using Visual WebPart in SharePoint 2010
When two web parts taking to each other, then you can say are connected web parts. They are like master/detail relationship. In a connected pair of web parts one web part is the provider and the other one is the consumer. There are two types of connections that web parts can use: static and dynamic. Static connections are only used for web parts pairs in which one web part does not reside in a web part zone. This would require writing a non-ASP.NET web part that derives from the Microsoft.SharePoint.Web-PartPages.WebPart class. Dynamic connections can be created using ASP.NET web parts.
To work with a dynamic web part we need a common interface that will talk through. Lets create a web part and we will see how it is working.
For this first create an empty sharepoint project by going start -> Program Files -> Microsoft Visual Studio 2010. Then File ->New -> Project and From the New Project dialog box Select Empty SharePoint Template and give a Name and click on OK as shown in the figure.
In the next SharePoint Customization Wizard select the local site you want to debug and then
To work with a dynamic web part we need a common interface that will talk through. Lets create a web part and we will see how it is working.
For this first create an empty sharepoint project by going start -> Program Files -> Microsoft Visual Studio 2010. Then File ->New -> Project and From the New Project dialog box Select Empty SharePoint Template and give a Name and click on OK as shown in the figure.
In the next SharePoint Customization Wizard select the local site you want to debug and then
VC++ walkin for experience professionals
Here are some very good openings for VC++ professionals. Please find the details in the picture. And If job profile matches send your resume to fewlines4biju@gmail.com.
Thursday, September 22, 2011
This action is only valid for products that are currently installed in Setup project in C#.Net
I got "This action is only valid for products that are currently installed" error while uninstalling a setup from one of the servers. That set up I have made using Visual Studio 2010 set up project template. When I tried to uninstall the package it shows me error as This action is only valid for products that are currently installed. Also the repair and reinstall did not work for me.
Then I got the error, the errror was I installed the product in a different user id (Windows credentials) and I am trying to uninstall the set up with an other windows credential id. It will work when I uninstalled the set up with the userid (Windows credentials) I have installed.
Then I got the error, the errror was I installed the product in a different user id (Windows credentials) and I am trying to uninstall the set up with an other windows credential id. It will work when I uninstalled the set up with the userid (Windows credentials) I have installed.
Tuesday, September 20, 2011
Generating WCF Proxy using SvcUtil.exe
Svcutil.exe is a command line tool that helps to generate proxy class in C#.Net. It is very easy to call the WCF service using Visual studio like the way below: Right click on the project then go to Add service reference and then the Add Service Reference dialog will appear as shown in the figure below.
Then in the address bar give the address of the WCF service and click on Go. Example:
net.tcp://localhost/Design_Time_Addresses/SLicense/Service1/
Then in the address bar give the address of the WCF service and click on Go. Example:
net.tcp://localhost/Design_Time_Addresses/SLicense/Service1/
Monday, September 19, 2011
System.InvalidOperationException: Could not find default endpoint element that references contract 'IService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element
I got this error "System.InvalidOperationException: Could not find default endpoint element that references contract 'IService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element" while trying to generate the proxy class using gacutil.exe.
And to command is:
svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
[URL]/Design_Time_Addresses/Fewlines4Biju/Service1
Remember you have to go to Visual Studio 2010 command prompt and type this.
There are lot of solutions available to change the App.config file in WCF. But what I have done is simply funny. I have not given the proper URL. and once i have given the proper url that works for me and it generates the proxy class.
You can check more wcf articles.
And to command is:
svcutil /language:cs /out:generatedproxy.cs /config:app.config net.tcp://
[URL]/Design_Time_Addresses/Fewlines4Biju/Service1
Remember you have to go to Visual Studio 2010 command prompt and type this.
There are lot of solutions available to change the App.config file in WCF. But what I have done is simply funny. I have not given the proper URL. and once i have given the proper url that works for me and it generates the proxy class.
You can check more wcf articles.
Saturday, September 17, 2011
I too had a love story !!!
![]() |
| Simply Superb !!! |
Thanks to flipkart who delivered me the book in one day. I read the first chapter in the bus itself. Its seems interesting and I kept on reading. First I thought it must be a story of the boy who was visiting a place in every sunday but as the title shows its must be a bit different, I keep on reading and just got creazy to know about the story. On Thurs day I was very ill and could not able to sit in desk and I came back. But while in the bus I started reading that book again. Then I reached in my room, took medicine and again started reading the book, Every one in my family
Friday, September 16, 2011
Download file in C#.Net
You can download text file in the way as shown in the below in c#.Net.
string fileName = @"E:\Filename.txt";
Response.Clear();
Response.ContentType = "application/octet-stream";// "application/ms-word";
Response.AddHeader("Content-Disposition", "attachment;filename=abc.txt);
Response.WriteFile(fileName);
Response.Flush();
Response.Close();
string fileName = @"E:\Filename.txt";
Response.Clear();
Response.ContentType = "application/octet-stream";// "application/ms-word";
Response.AddHeader("Content-Disposition", "attachment;filename=abc.txt);
Response.WriteFile(fileName);
Response.Flush();
Response.Close();
Sunday, September 11, 2011
Create a sequential workflow using Visual studio 2010 in SharePoint 2010
Here we will discuss how to develop a sequential workflow using Visual studio 2010 in SharePoint 2010. Microsoft provides different project templates to work for SharePoint.
For this first open Visual studio 2010 and then File -> New Project.Then from the new project dialog box choose Visual C# and then Select SharePoint and from there select 2010 and Choose Sequential Workflow template and give a name in the Name box as shown in the figure below(SequentialWorkflow.png) and click on OK.
In the next step provide the local debugging URL and you will able to only deploy as farm solution is selected
SharePoint Interview Questions
You can also view SharePoint Interview Questions and Answers series Part-1 , Part-2 , Part-3 , Part-4 , Part-5.
- What is SharePoint?
- What is SharePoint architure?
- What is a Portal Technology?
- What's new in SharePoint 2010?
- How is SharePoint foundation 2010 differs from SharePoint Server 2010?
- What is Site provisioning?
- What is a SharePoint farm?
- What is Site and Site Collection?
- How to create a site using stsadm.exe?
- What is Customization and Personalization?
- What is SharePoint Feature and how to create and deploy a feature?
- What is Visual web part? And how to create and deploy a visual webpart using visual studio 2010?
- What is the work of SPVirtualPathProvider?
- What is ghosting and unghosting pages?
- What is difference between Site Pages versus Application Pages?
Friday, September 9, 2011
Diverse world of .Net
Diverse world of .Net
Developed by Microsoft Windows .Net is a software framework which runs on Microsoft Windows. Its library is as vast as ocean where each language can use code written in other language. Its library supply database connectivity, cryptography, data access, web application development, user interface network communication and numeric algorithm. .Net framework support several languages which are executed in the software platform which is known as Common Language Run time. Visual Studio is an integrated development environment which is used widely for .Net software framework. This vast and diverse family of .Net framework has two versions. One version is for Smartphone and other version is used for embedded system.
Extra ordinary features of .Net software frame work have enabled computer system to communicate with new and older application. As said above that .net has a vast library
Top-Down and Bottom-up Approach in Integration Testing:-
While doing Integration testing we are following Top-down and Bottom-up approach:-
Top-Down Approach:-
Integration of main module with some of the stub modules is called as Top-down approach.In this case we are using temporary programs instead of under constructive Stub modules.By doing this we can stop the control to the module which is under construction.
Bottom-Up Approach:-
Integration of sub modules without main module is called as Bottom-Up approach.In this case instead of main
Top-Down Approach:-
Integration of main module with some of the stub modules is called as Top-down approach.In this case we are using temporary programs instead of under constructive Stub modules.By doing this we can stop the control to the module which is under construction.
Bottom-Up Approach:-
Integration of sub modules without main module is called as Bottom-Up approach.In this case instead of main
Add and Delete an Item from one list to another list in Sharepoint 2010?
Using SharePoint workflow we can control the items of one list to another list. For ex we need to shortlist the candidate based on the condition of Project Assigned or not. Generally we will maintain a list of candidates and now we have to create another list which contains the candidates who were not assigned the project. So it will help to concentrate on those candidates separately to assign the project as soon.
Step:1
Create a list in sharepoint site
Goto to SiteAction -> moreoption -> List -> Custom List
Enter the name as CandidateList
Click create to complete
Goto to SiteAction -> moreoption -> List -> Custom List
Enter the name as CandidateList
Click create to complete
Step:2
Create some fields in candidate list with the following details
Thursday, September 8, 2011
.Net Walkin Bangalore
Hi All,
Here is the Job description for the walkin. If job profile matches please send resume in my mail id- fewlines4biju@gmail.com . The job openings is for KPIT cummins pvt ltd.
Candidate should be
1. Exp 3 to 5 Yrs
2. .Net 2.0
3. Strong in SQL Server
4. Should Join in 15 to 20 days
Here is the Job description for the walkin. If job profile matches please send resume in my mail id- fewlines4biju@gmail.com . The job openings is for KPIT cummins pvt ltd.
Candidate should be
1. Exp 3 to 5 Yrs
2. .Net 2.0
3. Strong in SQL Server
4. Should Join in 15 to 20 days
Wednesday, September 7, 2011
Defect Report Template:-(IEEE 829)
While test execution if any test case fails,then we are reporting those bugs in below format through defect tracking team in manual testing.
(1)Defect Id:-Unique number or Name.
(2)Defect description:-Summary of detected defect.
(3)Build Version Id:-Version number of current build.(Tester find that defect in that build version)
(4)feature/Module:-Name of the module(Tester detected this defect in that module)
(5)testcase Id:-Id of failed testcase.(Tester detected this defect while executing that testcase)
(6)Reproducible:-Yes/No
Yes:-If defect appears every time in test repetition.
(1)Defect Id:-Unique number or Name.
(2)Defect description:-Summary of detected defect.
(3)Build Version Id:-Version number of current build.(Tester find that defect in that build version)
(4)feature/Module:-Name of the module(Tester detected this defect in that module)
(5)testcase Id:-Id of failed testcase.(Tester detected this defect while executing that testcase)
(6)Reproducible:-Yes/No
Yes:-If defect appears every time in test repetition.
How to create a Site Definition using Visual studio 2010 in SharePoint 2010?
Introduction:
In this article we will see What is Site Definition in SharePoint and also will discuss details steps to create a site definition using visual studio 2010 in SharePoint 2010.
Description:
What is Site Definition in SharePoint 2010?
A site definition defines a unique type of Microsoft SharePoint Foundation website according to MSDN. It mainly contains some configurations to make a web site. SharePoint provides various out of box site defination templates like STS which is responsible to make site like Team site, Blank Site, Document workspace. MPS site defination is responsible for creating sites like Basic Meeting Workspace, Blank Meeting Workspace, Decision Meeting Workspace, Social Meeting Workspace, and Multipage Meeting Workspace etc. BLOG site defination is responsible creating sites like Blogs. CENTRALADMIN is responsible creating central administration websites.
In this article we will see What is Site Definition in SharePoint and also will discuss details steps to create a site definition using visual studio 2010 in SharePoint 2010.
Description:
What is Site Definition in SharePoint 2010?
A site definition defines a unique type of Microsoft SharePoint Foundation website according to MSDN. It mainly contains some configurations to make a web site. SharePoint provides various out of box site defination templates like STS which is responsible to make site like Team site, Blank Site, Document workspace. MPS site defination is responsible for creating sites like Basic Meeting Workspace, Blank Meeting Workspace, Decision Meeting Workspace, Social Meeting Workspace, and Multipage Meeting Workspace etc. BLOG site defination is responsible creating sites like Blogs. CENTRALADMIN is responsible creating central administration websites.
What is Bug Life cycle ?

While test execution if any defect came, tester is reporting that defect as “New” and sending to the defect tracking team by making its status as ”Assigned” for analysis. Tracking team analyzing the defect and if that defect is a bug then they are assigning to the concerned developer.Developer is
What is the difference between Error,Defect and Bug?
Here I am trying to explain what is the difference between Error, Defect and Bug in Testing.
Error/Flaw:
If a developer finds a mistake in coding then that mistake is called as Error/Flaw.
Defect/Issue:
If a tester detected any mistake in software coding then that mistake is called as Defect/Issue.
Bug:
If a testers defect was accepted by developers to fix then the defect is called as Bug. Sometime customer facing problems in software after release that is also called as Bug.
Error/Flaw:
If a developer finds a mistake in coding then that mistake is called as Error/Flaw.
Defect/Issue:
If a tester detected any mistake in software coding then that mistake is called as Defect/Issue.
Bug:
If a testers defect was accepted by developers to fix then the defect is called as Bug. Sometime customer facing problems in software after release that is also called as Bug.





























