<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">K. G. Sreeju Nair</title><subtitle type="html">Knowledge has to be improved, challenged, and increased constantly, or it vanishes.</subtitle><id>http://weblogs.asp.net/sreejukg/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/sreejukg/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2011-05-07T15:06:00Z</updated><entry><title>Developing custom field type for SharePoint 2010</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2012/02/05/developing-custom-field-type-for-sharepoint-2010.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2012/02/05/developing-custom-field-type-for-sharepoint-2010.aspx</id><published>2012-02-04T22:13:00Z</published><updated>2012-02-04T22:13:00Z</updated><content type="html">&lt;p&gt;The ECM features of SharePoint 2010 are excellent. The best thing is the extendibility of the platform using SharePoint designer and Visual Studio. By default SharePoint includes field types such as Single line text, multi-line text etc. The following is the snapshot of the fields available in SharePoint 2010&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_4B367B9E.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_4B367B9E.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_023059D8.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" alt="clip_image001" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_023059D8.png" border="0" height="199" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The out of the box field controls are useful for most situations, but still you may need additional field types when building business applications. Fortunately you can build custom field controls using Visual Studio 2010 and deploy to SharePoint. Custom field control can provide a unique editing and display experience. Custom field controls can be used to include custom client-side validation and a unique editing experience. &lt;/p&gt;  &lt;p&gt;In this article I am going to demonstrate how you can build custom field control for SharePoint 2010. For the purpose of this article, I am going to build a custom field control that inherits the single line of text. When displaying the control, it will show the entered text in &amp;lt;h1&amp;gt; tags. Also the field will convert the text to upper case while displaying. The custom field will throw error if it contains more than 10 characters. The examples looks simple, my intention is to show you how easily you can build custom controls. In real time you can add your business logic to build your own field controls. &lt;/p&gt;  &lt;p&gt;Open Visual Studio, from the file menu select new project. In the new project dialog, select empty SharePoint project as the template. I have named the project as “MyCustomFieldProject”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_7F2ACF57.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_7F2ACF57.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_024C9173.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_024C9173.jpg" border="0" height="128" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the SharePoint customization wizard, make sure you select “deploy as farm solution”. Also you can enter the local site URL where you can deploy the custom field.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_2DB0B26D.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_2DB0B26D.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_290A81E6.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_290A81E6.png" border="0" height="195" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click the Finish button. Visual Studio will create an empty project. In Visual Studio solution explorer, the project looks as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_760ACBB1.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_760ACBB1.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_08731C67.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_08731C67.png" border="0" height="133" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you need to add a class to the solution that represents the custom field. Now right click the project and select Add -&amp;gt; Class&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_2F7DB5DC.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_2F7DB5DC.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_244405C5.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image007" alt="clip_image007" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_244405C5.jpg" border="0" height="120" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have named the class as “MyHeaderField”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_34039AC9.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_34039AC9.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_0B085FF3.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image009" alt="clip_image009" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_0B085FF3.jpg" border="0" height="129" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The class just created have the following code.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_5325F602.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_5325F602.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_5C9EB478.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image010" alt="clip_image010" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_5C9EB478.png" border="0" height="163" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you need to set the class as public. You need to include the using statement to include Microsoft.SharePoint to get access to the Sharepoint built in types. As I mentioned initially MyHeaderField needs to inherit the SharePoint Text field which is “SPFieldText”. Now you need to override the 2 default construtors. After making the mentioned changes, the code file looks as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_1EE1A6EF.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_1EE1A6EF.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_32CB13B8.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image012" alt="clip_image012" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_32CB13B8.jpg" border="0" height="81" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now I am going to override 2 methods as follows.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;GetValidatedString – This will be used to validate the data before saving to database.&lt;/li&gt;    &lt;li&gt;GetFieldValueAsHtml – this is how the value will be displayed in the page.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The implementation of the methods are as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_50C921AC.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_50C921AC.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_2A1A955F.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image013" alt="clip_image013" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_2A1A955F.png" border="0" height="105" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Each field type you define should have a corresponding entry in the form of XML file in the XML folder under 14\Template folder. The XML file will have the following naming convention&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;It should start with fldtypes_&lt;/li&gt;    &lt;li&gt;After _ you can define the field name. It is a good practice to specify the class name as the field name, though it is not a must &lt;/li&gt;    &lt;li&gt;In the XML file, you need to define the fields such as TypeName, parent type name, type display name, corresponding class and assembly. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Now in the Visual Studio project, you need to add a XML file and while deploying it should be deployed to the folder 14\Template\XML. To do this, you can add a mapped folder to your project. Right click the project in solution explorer, select Add -&amp;gt; SharePoint mapped folder&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_1B5FC3AD.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_1B5FC3AD.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_1EEDB8BD.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image015" alt="clip_image015" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_1EEDB8BD.jpg" border="0" height="127" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the Add mapped folder dialog, expand Template and select XML&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_0A1BC03D.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_0A1BC03D.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_7B246B55.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image016" alt="clip_image016" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_7B246B55.png" border="0" height="244" width="192"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you can see the XML folder under your project. Any files created here will be deployed to the 14\Template\XML folder in the SharePoint farm where the solution is deployed. Now you need to add the XML file for your field.&lt;/p&gt;  &lt;p&gt;Right click the project, select Add -&amp;gt; New Item. Now in the template selection, select Data as the category and then select XML as the file type. I have named fldtypes_MyHeaderField.xml&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_4824B521.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_4824B521.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_08B6DBC4.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image018" alt="clip_image018" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_08B6DBC4.jpg" border="0" height="129" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have updated the content of the XML file as follows. Be noted that $SharePoint.Project.AssemblyFullName$ will be replaced automatically by the correct assembly name wile deploying. All the other fields are self-explanatory. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_5EF360D0.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_5EF360D0.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_39C5F097.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image020" alt="clip_image020" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_39C5F097.jpg" border="0" height="76" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now we are done with all the requirements. From the solution explorer, right click the project and click deploy. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_70BFCED0.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_70BFCED0.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_2ED8E982.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image021" alt="clip_image021" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_2ED8E982.png" border="0" height="86" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Once deployed, you can add new columns to SharePoint lists and libraries with the type “MyHeaderField”. Add the new column to SharePoint types will show the new type you added. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image022_017753B2.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image022_017753B2.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image022_thumb_3D736F9A.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image022" alt="clip_image022" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image022_thumb_3D736F9A.png" border="0" height="172" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have added a new column named “MyHeader” to my publishing page content type. Now when I try to add text to the column, it will validate it. See a simple validation &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_2AFAF918.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_2AFAF918.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_294A2D44.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image023" alt="clip_image023" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_294A2D44.png" border="0" height="34" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;SharePoint 2010 is extensible as you can build and deploy custom fields that address your custom business requirements. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8281980" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/sreejukg/archive/tags/C_2300_/default.aspx" /><category term="Visual Studio 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio+2010/default.aspx" /></entry><entry><title>Walkthrough: Wizard control in ASP.Net</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2012/01/21/walkthrough-wizard-control-in-asp-net.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2012/01/21/walkthrough-wizard-control-in-asp-net.aspx</id><published>2012-01-21T14:40:00Z</published><updated>2012-01-21T14:40:00Z</updated><content type="html">&lt;p&gt;In this article I am going to explain about the ASP.Net Wizard control and how you can use it in your application. When there are large forms, the wizard control is a useful tool that helps the end user to fill the form quiet easily. When you have large forms, it is a better approach to split the forms to various steps. In this article I am going to demonstrate how ASP.Net wizard control can be applied to multi-step form application. I am using ASP.Net 4.0 with Visual Studio 2010 for this demonstration. &lt;/p&gt;  &lt;p&gt;For the purpose of demonstration, I am going to build a form that contains the following steps &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Step 1: A welcome page, usually the first step gives an introduction to the form and filling instructions. For the purpose of this demonstration, I just enter some sample text there.&lt;/p&gt;    &lt;p&gt;Step 2: A page that collects personnel information such as name and gender, based on the selection the user will be redirected to either step 3 or step 4.&lt;/p&gt;    &lt;p&gt;Step 3: User will enter wife name here&lt;/p&gt;    &lt;p&gt;Step 4: User will enter husband name here&lt;/p&gt;    &lt;p&gt;Step 5: All the selection will be displayed here&lt;/p&gt;    &lt;p&gt;Step 6: Data will be saved and display thank you message.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;These steps are simple and I am sure in real time you will not get chance to do simple stuff like this. But for the purpose of demonstration I believe this is more than enough.&lt;/p&gt;  &lt;p&gt;I created an ASP.Net web application and added a wizardSample.aspx page to it. In the Visual Studio toolbox, you can see wizard control under the standard tab.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_07735793.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_07735793.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_242CCCA8.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" alt="clip_image001" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_242CCCA8.png" border="0" height="244" width="224"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Drag and drop the Wizard to the page. The default view of the Wizard control in the designer surface is as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_457C4C77.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_457C4C77.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_58BD0316.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" alt="clip_image002" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_58BD0316.png" border="0" height="69" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Drag the control with the necessary width and height. Now in the designer, click on the Step1, now in the right side area (as marked in the below image) you can add the content for the selected step, in our case step1. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_4ADA974E.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_4ADA974E.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_4F70A208.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_4F70A208.png" border="0" height="103" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I entered some content for Step 1. The Designer surface looks as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_3EA8F75A.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_3EA8F75A.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_3C8BF891.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_3C8BF891.png" border="0" height="108" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Let us run the project. The output in the browser is as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_52FE9718.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_52FE9718.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_70FCA50C.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_70FCA50C.png" border="0" height="123" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now let us add all the 6 steps to the wizard. We already have 2, so need to add 4 more. From the design mode, you can see the arrow at right top of the wizard. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_439B0F3C.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_439B0F3C.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_256D5188.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image007" alt="clip_image007" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_256D5188.jpg" border="0" height="101" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click on the arrow at the right top, the smart navigation will appear. Click on Add or remove wizard steps from the list.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_7231181E.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_7231181E.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_7C35937C.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image009" alt="clip_image009" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_7C35937C.jpg" border="0" height="75" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now visual studio will bring wizard collection editor. You can add, remove and modify the wizard steps using this editor.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_0137D12C.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_0137D12C.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_04599347.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image010" alt="clip_image010" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_04599347.png" border="0" height="177" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click on the Add button to add a new wizard step to the wizard. Normally you need to add a proper title and select a StepType here. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_1EF60993.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_1EF60993.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_1D3517F2.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image011" alt="clip_image011" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_1D3517F2.png" border="0" height="175" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click OK once you are done. Use the same steps to add three more steps to the wizard. For the last step, I selected Finish as the Step Type. &lt;/p&gt;  &lt;p&gt;Now I am going to format my wizard control. Click on the Smart Tag arrow and select Auto format.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_71C0D12A.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_71C0D12A.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_2F6DB8E7.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image012" alt="clip_image012" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_2F6DB8E7.png" border="0" height="219" width="234"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;By default wizard control comes with 4 styles. I have chosen classic as my style. This is a great option as with out much effort you will get a standard wizard theme.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_7A80B3A9.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_7A80B3A9.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_26F9BDC3.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image014" alt="clip_image014" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_26F9BDC3.jpg" border="0" height="137" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Also if you want to remove the selected formatting, just use “Remove formatting Option” in the auto format dialog. &lt;/p&gt;  &lt;p&gt;Now Let us add other steps as mentioned. Select step 2 in the design surface of Visual studio. In the step 2 I need to collect the name and gender from the user. I have placed the Textbox control and radio button list in the step 2. Also I placed required field validator for both. So user cannot go to next step without entering the values. Once added all the controls, my design surface looks as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_1293F838.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_1293F838.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_02A4B374.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image015" alt="clip_image015" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_02A4B374.png" border="0" height="102" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now based on the gender selection we need to send the user to either step 3 or step 4. You need to add the event handler for the Next button. Here you need to note one thing, the previous, next etc. buttons are common for all wizard steps. So in the event handler you need to check whether you are in step 2, then check the radio button list selected value and set the appropriate step as the active step. &lt;/p&gt;  &lt;p&gt;To define the event handler, Click on the Wizard and in the properties Window, select the events.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_2E08D46E.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_2E08D46E.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_75BA3788.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image017" alt="clip_image017" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_75BA3788.jpg" border="0" height="96" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can enter a name in the right column on NextButtonClick, or simply double click; Visual Studio will create a default method name. The default method created is as follows&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_4543B312.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_4543B312.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_4392E73E.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image018" alt="clip_image018" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_4392E73E.png" border="0" height="36" width="244"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Write the following code in the method.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;if (Wizard1.ActiveStepIndex == 1)     &lt;br&gt;{      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (rdoGender.SelectedValue == "Male")      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wizard1.ActiveStepIndex = 2;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wizard1.ActiveStepIndex = 3;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;}      &lt;br&gt;else if (Wizard1.ActiveStepIndex == 2)      &lt;br&gt;{      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Wizard1.ActiveStepIndex = 4;      &lt;br&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I believe the code is self-explanatory. If male is selected, it will redirect the user to the Third Step (i.e. with index 2) otherwise to step 4. Once the user clicks next from the step 3, the user will be navigated to step 5. &lt;/p&gt;  &lt;p&gt;In the Design Surface, Click on the Step 3 add a label and textbox control to the content area. The design of Step 3 in Visual studio is as follows. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_5ADDEBAF.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_5ADDEBAF.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_0DCD7C17.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image019" alt="clip_image019" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_0DCD7C17.png" border="0" height="106" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The design for Step 4 is as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_2BCB8A0B.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_2BCB8A0B.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_49C997FF.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image020" alt="clip_image020" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_49C997FF.png" border="0" height="103" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now in step 5, I am going to show all data back to the user. I placed some labels in the step. I need to load the control values; this can be done in the Step activation event handler. To write event handler for step activation, you can perform the following steps.&lt;/p&gt;  &lt;p&gt;From Visual studio, go to the source view of your page and locate the wizard step 5.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_39DA533B.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_39DA533B.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_29EB0E77.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image021" alt="clip_image021" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_29EB0E77.png" border="0" height="79" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now in the &amp;lt;asp:WizardStep, you can find OnActivate event , &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image022_7491D644.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image022_7491D644.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image022_thumb_0B0474CC.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image022" alt="clip_image022" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image022_thumb_0B0474CC.png" border="0" height="100" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the code in Visual Studio for Wizard Step 5&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_7BA0ECEF.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_7BA0ECEF.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_12EBF161.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image023" alt="clip_image023" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_12EBF161.png" border="0" height="15" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have entered the following code In the Step5_Activate event handler. The code looks as follows&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image024_7C49A319.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image024_7C49A319.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image024_thumb_2F393381.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image024" alt="clip_image024" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image024_thumb_2F393381.png" border="0" height="113" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the Step 6, I have entered some Thank you message for the user. Now user can navigate to steps either by the button or by the left navigation menu.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image025_25FCF840.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image025_25FCF840.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image025_thumb_31B23F72.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image025" alt="clip_image025" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image025_thumb_31B23F72.png" border="0" height="232" width="229"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Since I want the user to navigate to each step by using the button, I am going to disable the left navigation links. In the Visual Studio designer, select the Wizard control. In the properties window, see the DisplaySideBar property and set it to false&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image026_3A5297FE.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image026_3A5297FE.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image026_thumb_13A40BB1.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image026" alt="clip_image026" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image026_thumb_13A40BB1.png" border="0" height="113" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you are ready to test your code. See the screenshot of steps.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image027_4959510B.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image027_4959510B.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image027_thumb_32B702C4.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image027" alt="clip_image027" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image027_thumb_32B702C4.png" border="0" height="99" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image028_25DCACA6.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image028_25DCACA6.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image028_thumb_43DABA9A.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image028" alt="clip_image028" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image028_thumb_43DABA9A.png" border="0" height="103" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image029_5B25BF0B.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image029_5B25BF0B.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image029_thumb_2B87A07F.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image029" alt="clip_image029" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image029_thumb_2B87A07F.png" border="0" height="101" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image030_29D6D4AB.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image030_29D6D4AB.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image030_thumb_0400AE48.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image030" alt="clip_image030" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image030_thumb_0400AE48.png" border="0" height="102" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image031_6D5E6000.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image031_6D5E6000.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image031_thumb_009F16A0.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image031" alt="clip_image031" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image031_thumb_009F16A0.png" border="0" height="103" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Wizard is a useful tool for developers that can be used to split complex forms in to multiple steps. The user can fill the form step by step. In each step the validation can be performed. Using this developer can hide the complexity of the form from the end user.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8265830" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="ASP.Net" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net/default.aspx" /><category term="ASP.Net 4" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net+4/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio/default.aspx" /><category term="Visual Studio 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio+2010/default.aspx" /></entry><entry><title>SharePoint 2010: Missing new and edit options from the Site Menu</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2012/01/08/sharepoint-2010-missing-new-and-edit-options-from-the-site-menu.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2012/01/08/sharepoint-2010-missing-new-and-edit-options-from-the-site-menu.aspx</id><published>2012-01-08T09:14:00Z</published><updated>2012-01-08T09:14:00Z</updated><content type="html">&lt;p&gt;Recently one of SharePoint WCM client has reported that they were not able to update the site. All the edit/new/upload menu items were missing from the site. It was fine till the week before and suddenly it happened. I thought of publishing the steps for troubleshooting the issue as it may help somebody facing similar issues.&lt;/p&gt;  &lt;p&gt;When I went to the Pages library after signed in as administrator, the site menu appears as follows. All update operations links are missing!&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_5DA56129.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_5DA56129.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_1E17FDD9.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" alt="clip_image001" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_1E17FDD9.png" height="244" border="0" width="201"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the document library, there was not upload / new links. The images library looked like below&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_3158B478.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_3158B478.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_0226C8E1.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_0226C8E1.jpg" height="78" border="0" width="774"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;There was no changes applied to the site during the past few weeks, no new users added, no modifications made on the user accounts and all users were able to log in. Checking the windows events gave a more clear picture. The was the following error in the event log&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;i&gt;&lt;/i&gt;&lt;/p&gt;    &lt;h6&gt;&lt;i&gt;“Database full error on SQL Server instance '10.0.0.1' in database 'WSS_Content'. Additional error information from SQL Server is included below.&lt;/i&gt;&lt;/h6&gt;    &lt;h6&gt;&lt;i&gt;Could not allocate space for object 'dbo.EventLog'.'EventLog_Id' in database 'WSS_Content' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.”&lt;/i&gt;&lt;/h6&gt; &lt;/blockquote&gt;  &lt;p&gt;I have found the following technet article that related with the error. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://technet.microsoft.com/en-us/library/ee513057.aspx" mce_href="http://technet.microsoft.com/en-us/library/ee513057.aspx"&gt;http://technet.microsoft.com/en-us/library/ee513057.aspx&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;But in our case, all the databases have auto growth settings set to on. There was no problem in the file settings. Suddenly we have noticed that the D:\ drive which was configured for SQL server data&amp;nbsp; storage have 0 GB free out of the 500 GB. &lt;/p&gt;  &lt;p&gt;The issue was the Database administrator forgot to set back up age for SQL server backup files and it took all the disk - space. We have deleted old backup files and decided to move the backup to another folder and decided to keep backup for only one month. &lt;/p&gt;  &lt;p&gt;After freeing the space, still the edit options were missing from the site. The reason was that when SharePoint found there is no space available in SQL server, it made the site collection with read only lock, so no more updates can be performed. &lt;/p&gt;  &lt;p&gt;In the application management Tab of central administration, under site collections there is a section for Configure quotas and locks.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_15677F80.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_15677F80.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_33D1C069.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_33D1C069.jpg" height="99" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have found the site collection was made read only. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_523C0152.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_523C0152.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_1BEAD943.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image007" alt="clip_image007" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_1BEAD943.jpg" height="96" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have made the site status to “Not locked” and click on “OK” button at the bottom of the page. Everything became normal, the new and edit menu items started appearing. &lt;/p&gt;  &lt;p&gt;SharePoint 2010 made the database read-only when it saw there was no space available for data storage. This was a very good approach that prevents damaging the database due to in-completed update operations. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8233706" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /><category term="SQL Server" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SQL+Server/default.aspx" /></entry><entry><title>New Request validation features in ASP.Net 4.5</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/12/20/new-request-validation-features-in-asp-net-4-5.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/12/20/new-request-validation-features-in-asp-net-4-5.aspx</id><published>2011-12-20T04:55:00Z</published><updated>2011-12-20T04:55:00Z</updated><content type="html">&lt;p&gt;(This article is based on ASP.Net 4.5 developer preview, when the version is released there may be changes applied.)&lt;/p&gt;  &lt;p&gt;ASP.Net request validation is a feature that automatically protects ASP.Net applications from XSS attacks. Request validation in asp.net triggers error when it found HTML markup in any of the input data. But some real life applications still require HTML data in some of the input fields. For e.g. When receiving feedback from user, you may need to get the feedback as HTML. Prior to 4.5 the developers have the ability to switch off the request validation either in page level or for the entire application. Even though this was helpful, for accepting HTML markup from any one field in the page, you were required to disable the validation for entire page or disable it for entire application. &lt;/p&gt;  &lt;p&gt;ASP.Net 4.5 brings some improvements to the request validation features. There is a new attribute introduced to httpRuntime element called requestValidationMode. You can set value for this attribute to 4.5 so that new improvements will be applied to your application.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;httpRuntime requestValidationMode="4.5" ... /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When you set this in your web.config, the request validation will be triggered only when your code access the data. So if you are not accessing the data, it will not be validated, which is an improvement and you are not supposed to disable the request Validation.&lt;/p&gt;  &lt;p&gt;Now the next question is what will happen when you need HTML data from controls? ASP.Net 4.5 allows you to access request data that is not validated from a new collection named “Unvalidated”. Once you set the requestValidationMode to 4.5, you can access the unvalidated data by the following statement. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;context.Request.Unvalidated.Form["Your_Column_Name"]; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I am going to demonstrate these new improvements in the remaining part of this article. First I am going to demonstrate the request validation prior to ASP.Net 4.5. Then I will demonstrate the request validation in ASP.Net 4.5 with HTML input controls and then with ASP.Net server controls.&lt;/p&gt;  &lt;p&gt;Let us evaluate an ASP.Net application prior to version 4.5. I have created ASP.Net 3.5 application and placed 2 text box controls in the page, with a submit button. The design mode for my page in Visual Studio looks similar to following.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_0076A763.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_0076A763.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_3940DB63.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" alt="clip_image002" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_3940DB63.jpg" height="53" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I executed the page and enter some data in the text boxes. See the snapshot of my input.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_3C069056.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_3C069056.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_013EE780.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_013EE780.png" height="97" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the comments Text box have some HTML markup, which will not be allowed by default. When clicking on the submit button, the following error page will appear.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_1889EBF1.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_1889EBF1.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_7DDD4FD7.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_7DDD4FD7.jpg" height="106" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now Since I am using ASP.Net 3.5, there are 2 options for me.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;1. Set the ValidateRequest to false in the @Page attribute of your page&lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_034BC07C.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_034BC07C.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_41D10E22.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image006" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_41D10E22.png" height="51" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;2. Set the ValidateRequest to false in the Pages section of web.config&lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_603B4F0B.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_603B4F0B.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_7F11C2E9.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image007" alt="clip_image007" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_7F11C2E9.png" height="27" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Once you do any of the above changes, the above error will vanishes. But there is a danger that all fields in your page can still cause XSS attacks as you disabled it for entire page. Disabling it from the entire application using web.config is more danger as it will switch off the validation feature for your application. Developers need to properly parse/validate all the fields in the page to safeguard from XSS attacks. &lt;/p&gt;  &lt;p&gt;Now let us evaluate the improvements in ASP.Net 4.5. I opened Visual Studio 2011 developer preview and created ASP.Net 4.5 web application. &lt;/p&gt;  &lt;p&gt;In my application I have included two text boxes and a submit button. The markup for the form controls are as follows. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_7E395CFF.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_7E395CFF.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_2AE216D9.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image008" alt="clip_image008" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_2AE216D9.png" height="128" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See, I have used normal HTML controls, not HTML server controls/ASP.Net server controls. I shall discuss the input validation for ASP.Net server controls in the later part of this article.&lt;/p&gt;  &lt;p&gt;I executed the page and placed some HTML in the comments field. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_1B5F050A.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_1B5F050A.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_52C51638.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image009" alt="clip_image009" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_52C51638.png" height="97" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When I clicked the submit button, there was no error.&lt;/p&gt;  &lt;p&gt;If you check the web.config, you can see the below setting in the web.config&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_4656F30F.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_4656F30F.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_37401435.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image010" alt="clip_image010" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_37401435.png" height="51" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now let me try to access these values from my code. I added onclick event handler for the button. The code for the button click event hander is as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_3CAE84D9.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_3CAE84D9.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_26E49C7C.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image011" alt="clip_image011" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_26E49C7C.png" height="36" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now When I click the button from the ASP.Net page, after entering value &amp;lt;b&amp;gt;No Comments&amp;lt;/b&amp;gt; in the comments Text box, the below error page appears. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_41448F93.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_41448F93.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_3F93C3BF.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image013" alt="clip_image013" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_3F93C3BF.jpg" height="101" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As mentioned in the introduction of this article, you can use Request.Unvalidated collection to access the unvalidated data from the code behind. I have updated my code as follows&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_3010B1F0.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_3010B1F0.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_35EB5589.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image014" alt="clip_image014" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_35EB5589.png" height="34" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now When I pressed the button, the page does not throw any error.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_148BAFED.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_148BAFED.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_2523AADB.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image015" alt="clip_image015" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_2523AADB.png" height="86" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You must be noticed that I have used HTML input fields not ASP.Net server controls. When using ASP.Net server controls ASP.Net uses the posted data to maintain the view state, so even if you didn’t use the server control data in the code behind, you will get error.&lt;/p&gt;  &lt;p&gt;See the sample. I have created the ASP.Net controls as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_11964B3A.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_11964B3A.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_7D9CB8A3.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image016" alt="clip_image016" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_7D9CB8A3.png" height="76" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the output of the page. I placed some markup in the comments field and pressed enter. No matter whether I am using the value in my code behind or not, it will throw the error.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_14E7BD15.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_14E7BD15.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_0564AB46.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image017" alt="clip_image017" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_0564AB46.png" height="99" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_640505A9.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_640505A9.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_305C994B.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image019" alt="clip_image019" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_305C994B.jpg" height="101" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is because; ASP.Net tries to access the data from text box for the purpose of maintaining view state. For managing request validation for ASP.Net controls, the framework introduced a new attribute named “ValidateRequestMode”. If you want any control to submit HTML markup, set the ValidateRequestMode to “disabled”, so that the data from this control will not be validated. In the background ASP.Net might take the data from the unvalidated collection if ValidateRequestMode set to disabled.&lt;/p&gt;  &lt;p&gt;See the sample. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_67C2AA79.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_67C2AA79.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_2647F820.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image020" alt="clip_image020" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_2647F820.png" height="52" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now run the page and enter some markup for the comments field and press the submit button, it will not trigger any error as you already disabled the validateRequestMode.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_7DC9160B.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_7DC9160B.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_756540B4.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image021" alt="clip_image021" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_756540B4.png" height="111" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the output of the page. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0151_2FE04089.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0151_2FE04089.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0151_thumb_193DF242.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image015[1]" alt="clip_image015[1]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0151_thumb_193DF242.png" height="86" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;ASP.Net 4.5 gives you the ability to control the request validation from item level. For each server control you can disable the request validation. Still all the other controls in the page is validated so your page is not open for XSS attacks. Make sure you apply necessary logic to parse/validate the data from unvalidated controls to protect your application. Only disable request validation when it is necessary.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8145373" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="ASP.Net" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio/default.aspx" /><category term="Visual Studio 2011" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio+2011/default.aspx" /><category term="Visual Studio Developer Preview" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio+Developer+Preview/default.aspx" /><category term="ASP.Net 4.5" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net+4.5/default.aspx" /></entry><entry><title>New HTML 5 input types in ASP.Net 4.5 Developer Preview</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/11/28/new-html-5-input-types-in-asp-net-4-5.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/11/28/new-html-5-input-types-in-asp-net-4-5.aspx</id><published>2011-11-28T04:44:00Z</published><updated>2011-11-28T04:44:00Z</updated><content type="html">&lt;p&gt;Microsoft has released developer previews for Visual Studio 2011 and .Net framework 4.5. There are lots of new features available in the developer preview. One of the most interested things for web developers is the support introduced for new HTML 5 form controls. &lt;/p&gt;  &lt;p&gt;The following are the list of new controls available in HTML 5&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;email&lt;/li&gt;    &lt;li&gt;url&lt;/li&gt;    &lt;li&gt;number&lt;/li&gt;    &lt;li&gt;range&lt;/li&gt;    &lt;li&gt;Date pickers (date, month, week, time, datetime, datetime-local)&lt;/li&gt;    &lt;li&gt;search&lt;/li&gt;    &lt;li&gt;color&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Describing the functionality for these controls is not in the scope of this article. If you want to know about these controls, refer the below URLs&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/hh547102.aspx" mce_href="http://msdn.microsoft.com/en-us/magazine/hh547102.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/hh547102.aspx&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.w3schools.com/html5/html5_form_input_types.asp" mce_href="http://www.w3schools.com/html5/html5_form_input_types.asp"&gt;http://www.w3schools.com/html5/html5_form_input_types.asp&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;ASP.Net 4.5 introduced more possible values to the Text Mode attribute to cater the above requirements. Let us evaluate these. I have created a project in Visual Studio 2011 developer preview, and created a page named “controls.aspx”. In the page I placed on Text box control from the toolbox&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0014_72E36921.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0014_72E36921.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0014_thumb_2FB7EAF4.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001[4]" alt="clip_image001[4]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0014_thumb_2FB7EAF4.png" height="242" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now select the control and go to the properties pane, look at the TextMode attribute. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0024_3FE3B2ED.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0024_3FE3B2ED.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0024_thumb_3E9F1A0E.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002[4]" alt="clip_image002[4]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0024_thumb_3E9F1A0E.png" height="228" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you can see more options are added here than prior versions of ASP.Net. I just selected Email as TextMode. I added one button to submit my page. The screen shot of the page in Visual Studio 2011 designer is as follows&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0034_4AC09435.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0034_4AC09435.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0034_thumb_34F6ABD8.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003[4]" alt="clip_image003[4]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0034_thumb_34F6ABD8.png" height="70" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the corresponding markup&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;form id="form1" runat="server"&amp;gt;     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enter your email:      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:TextBox ID="TextBox1" runat="server" TextMode="Email"&amp;gt;&amp;lt;/asp:TextBox      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Button ID="Button1" runat="server" Text="Submit" /&amp;gt;      &lt;br&gt;&amp;lt;/form&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now let me run this page, IE 9 do not have the support for new form fields. I browsed the page using Firefox and the page appears as below.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0044_418458F4.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0044_418458F4.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0044_thumb_40ABF30A.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004[4]" alt="clip_image004[4]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0044_thumb_40ABF30A.png" height="59" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;From the source of the rendered page, I saw the below markup for my email textbox&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;input name="TextBox1" type="email" id="TextBox1" /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Try to enter an invalid email and you will see the browser will ask you to enter a valid one by default. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0054_58632A70.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0054_58632A70.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0054_thumb_5E3DCE09.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005[4]" alt="clip_image005[4]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0054_thumb_5E3DCE09.png" height="92" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When rendered in non-supported browsers, these fields are behaving just as normal text boxes. So make sure you are using validation controls with these fields.&lt;/p&gt;  &lt;p&gt;See the browser support compatability matrix with these controls with various browser vendors.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0064_439131F0.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0064_439131F0.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0064_thumb_340E2021.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image006[4]" alt="clip_image006[4]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0064_thumb_340E2021.png" height="85" border="0" width="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;ASP.Net 4.5 introduced the support for these new form controls. You can build interactive forms using the newly added controls, keeping in mind that you need to validate the data for non-supported browsers. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8078362" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="ASP.Net" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio/default.aspx" /><category term="Visual Studio 2011" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio+2011/default.aspx" /><category term="Visual Studio Developer Preview" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio+Developer+Preview/default.aspx" /><category term="ASP.Net 4.5" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net+4.5/default.aspx" /></entry><entry><title>Create a List Definition in SharePoint 2010 using Visual Studio 2010</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/11/03/create-a-list-definition-in-sharepoint-2010-using-visual-studio-2010.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/11/03/create-a-list-definition-in-sharepoint-2010-using-visual-studio-2010.aspx</id><published>2011-11-03T13:13:00Z</published><updated>2011-11-03T13:13:00Z</updated><content type="html">&lt;p&gt;In this demonstration, I am going to create a list definition using Visual Studio 2010. For the demonstration purpose, I am going to create a list definition for storing expenses, once deployed, the list definition can be used to create lists to store expenses. The list definition will define a list template that inherit from custom list and add columns expensedate and amount. &lt;/p&gt;  &lt;p&gt;Open Visual Studio, Go to File -&amp;gt; New project, In the Template selection dialog, choose List Definition as the template type. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Give a proper name to your List Definition project. Make sure the .Net framework selected is 3.5 as SharePoint 2010 is built on .Net framework 3.5.&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_603528E2.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_603528E2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_1B58DEE1.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" alt="clip_image002" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_1B58DEE1.jpg" height="151" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click OK button, once you entered all the details. &lt;/p&gt;  &lt;p&gt;In the next dialog you need to choose the SharePoint portal you need to use for debug. Also you need to specify whether it is a farm solution or sand boxed solution. Enter your SharePoint portal address and Click Next &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_31CB7D68.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_31CB7D68.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_1C211EFE.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_1C211EFE.png" height="196" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click Next once you are done&lt;/p&gt;  &lt;p&gt;Now Visual Studio will bring you the List definition settings dialog. Here you can define the title for your list definition and choose a base list to inherit from. I choose my base list as “Custom List”. In addition to this you can decide whether to include a list instance when deploying this feature. Since I want to check my list definition, I selected “Add a list instance to this list definition” option. Click finish button, once you are done&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;     &lt;br&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_489A2917.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_489A2917.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_5BDADFB6.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_5BDADFB6.png" height="194" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click Finish button once you are done with this step.&lt;/p&gt;  &lt;p&gt;Visual Studio will add a default feature to your project and add a list definition. In the solution explorer the project will look similar to the following. I published an article for developing a SharePoint 2010 feature using Visual Studio, to read that article click here.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_20A703EB.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_20A703EB.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_02E5792C.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_02E5792C.png" height="237" width="225" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Let me explain the files exists under the List Definition&lt;/p&gt;  &lt;p&gt;Elements.xml – this file defines the list template and fields such as name, display name, type etc. The properties specified in this file will be displayed in the Create Page, when you create a list template from this file.&lt;/p&gt;  &lt;p&gt;Let us examine the Elements.Xml file. See the snapshot of the elements.xml file &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_3C881316.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_3C881316.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_3CC4964B.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image006" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_3CC4964B.png" height="147" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The complete reference for Elements file for List template can be found in the below URL&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms462947.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms462947.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms462947.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The type identifier must be unique within the feature, but need not be unique across all feature definitions or site definitions. So make sure when you have multiple list templates in the same feature, you made them with different type attributes. It is also recommended to create Type value greater than 10000. For my List Instance I assigned the Type attribute with a value of 10001.&lt;/p&gt;  &lt;p&gt;After Modifications, the List template file looks as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_076B5E19.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_076B5E19.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_12483F61.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image007" alt="clip_image007" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_12483F61.png" height="143" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Notice that, I just updated the Type attribute, but depending on your needs you may add other attributes. &lt;/p&gt;  &lt;p&gt;Now I am going to add fields for my List template. As I mentioned initially, I will have only 2 fields date and amount. Refer this link to under stand more about Field element &lt;a href="http://msdn.microsoft.com/en-us/library/ms437580.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms437580.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms437580.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;When you define a field, you need to specifiy a guid as ID enclosed in braces{}. To create a Guid, do the following steps.&lt;/p&gt;  &lt;p&gt;From visual Studio menu, select tools, then select create guid&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_089FD12B.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_089FD12B.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_06EF0557.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image009" alt="clip_image009" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_06EF0557.jpg" height="244" width="223" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The Create Guid dialog will appear as follows&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_3E551685.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_3E551685.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_4A0A5DB7.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image010" alt="clip_image010" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_4A0A5DB7.png" height="244" width="239" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I have added the following fields to List Template. &lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;blockquote&gt;   &lt;h6&gt;&amp;lt;Field Type="DateTime" DisplayName="Expense Date" Required="TRUE" ID="{AB764690-E5F3-48EC-8E54-EDDB6900574A}" StaticName="ExpenseDate" Name="ExpenseDate" Group="Expense Columns" /&amp;gt;     &lt;br&gt;&amp;lt;Field Type="Number" DisplayName="Amount" Required="TRUE" ID="{DDCD3DE5-5975-4C4E-B0C2-1460D84EC7A8}" StaticName="Amount" Name="Amount" Group="Expense Columns" /&amp;gt;&lt;/h6&gt; &lt;/blockquote&gt;  &lt;p&gt;Make sure for each field you create you use unique guid. Now I want to create a content type that includes these fields. When you define a content type, you need to define an ID for the content type. This is a bit tricky. Refer the below article to under stand more about content type ID. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa543822.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa543822.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa543822.aspx&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;My content type should be a sub of item content type, so I am going to use the following rule to create my list content type id. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table width="505" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;         &lt;tr&gt;           &lt;td valign="top" width="47"&gt;             &lt;p align="center"&gt;System&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="64"&gt;             &lt;p align="center"&gt;Item&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="68"&gt;             &lt;p align="center"&gt;prefix&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="324"&gt;             &lt;p align="center"&gt;Hexadecimal GUID&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="47"&gt;             &lt;p align="center"&gt;0x&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="64"&gt;             &lt;p align="center"&gt;01&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="68"&gt;             &lt;p align="center"&gt;00&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="324"&gt;             &lt;p align="center"&gt;4FDDEDBF38D14332A625BCBC60F1667A&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;       &lt;/tbody&gt;&lt;/table&gt;   &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;(for hexadecimal guid, I create a guid from visual studio and then removed braces and hyphens)&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;So my content type id is 0x01004FDDEDBF38D14332A625BCBC60F1667A&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Add the following content type tag just above the ListTemplate start tag.&lt;/p&gt;  &lt;blockquote&gt;   &lt;h6&gt;&amp;lt;ContentType ID="0x01004FDDEDBF38D14332A625BCBC60F1667A" Name="Expense Item" Group="Expense Content Types" Description="Expense item content type." &amp;gt;     &lt;br&gt;&amp;nbsp; &amp;lt;FieldRefs&amp;gt;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldRef ID="{AB764690-E5F3-48EC-8E54-EDDB6900574A}"/&amp;gt;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FieldRef ID="{DDCD3DE5-5975-4C4E-B0C2-1460D84EC7A8}"/&amp;gt;      &lt;br&gt;&amp;nbsp; &amp;lt;/FieldRefs&amp;gt;      &lt;br&gt;&amp;lt;/ContentType&amp;gt;&lt;/h6&gt; &lt;/blockquote&gt;  &lt;p&gt;The definition is very straight forward. See the &amp;lt;FieldRefs&amp;gt; tags where you add the reference to previously created fields.&lt;/p&gt;  &lt;p&gt;Find the snapshot of Elements.xml file after the above items added.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_588559DC.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_588559DC.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_4BA6EFBF.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image012" alt="clip_image012" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_4BA6EFBF.jpg" height="137" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you have defined fields, content type and list template. Now you need to link your list definition to content type. You need to perform this in the schema.xml file. Open schema.xml file, by default it will look similar to the below snapshot.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_28967E4F.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_28967E4F.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_774793EE.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image013" alt="clip_image013" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_774793EE.png" height="152" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you need to replace the &amp;lt;ContentTypes&amp;gt;&amp;lt;/ContentTypes&amp;gt; element with the below&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;blockquote&gt;   &lt;h6&gt;&amp;lt;ContentTypes&amp;gt;     &lt;br&gt;&amp;nbsp; &amp;lt;ContentTypeRef ID="0x01004FDDEDBF38D14332A625BCBC60F1667A"&amp;gt;&amp;lt;/ContentTypeRef&amp;gt;      &lt;br&gt;&amp;lt;/ContentTypes&amp;gt;&lt;/h6&gt; &lt;/blockquote&gt;  &lt;p&gt;Now copy all the &amp;lt;Field&amp;gt; tags from Elements.xml and paste in between &amp;lt;Fields&amp;gt; and &amp;lt;/Fields&amp;gt;. This is a duplication of work but you need to do this. After replaced, the Fields tag will look as follows. &lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;h6&gt;&amp;lt;Fields&amp;gt;   &lt;br&gt;&amp;nbsp; &amp;lt;Field Type="DateTime" DisplayName="Expense Date" Required="TRUE" ID="{AB764690-E5F3-48EC-8E54-EDDB6900574A}"    &lt;br&gt;&amp;nbsp; StaticName="ExpenseDate" Name="ExpenseDate" Group="Expense Columns" /&amp;gt;    &lt;br&gt;&amp;nbsp; &amp;lt;Field Type="Number" DisplayName="Amount" Required="TRUE" ID="{DDCD3DE5-5975-4C4E-B0C2-1460D84EC7A8}"    &lt;br&gt;&amp;nbsp; StaticName="Amount" Name="Amount" Group="Expense Columns" /&amp;gt;    &lt;br&gt;&amp;lt;/Fields&amp;gt;&lt;/h6&gt;  &lt;p&gt;Now you need to add the field references to view fields. There will be multiple &amp;lt;View&amp;gt; tags, you can add field references in all or atleast in the View with BaseViewID=1, as this is the default view. See the snapshot of default view in the schema.xml file&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_67584F2A.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_67584F2A.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_78E839F5.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image014" alt="clip_image014" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_78E839F5.png" height="53" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In between ViewFields add the below markup. &lt;/p&gt;  &lt;p&gt;&amp;lt;FieldRef Name="ExpenseDate"&amp;gt;&amp;lt;/FieldRef&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;FieldRef Name="Amount"&amp;gt;&amp;lt;/FieldRef&amp;gt;&lt;/p&gt;  &lt;p&gt;See the snapshot of schema.xml after made the changes.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_2F75E53A.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_2F75E53A.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_12AC4A58.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image016" alt="clip_image016" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_12AC4A58.jpg" height="110" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_70080BDC.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_70080BDC.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_4493C515.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image018" alt="clip_image018" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_4493C515.jpg" height="107" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you are done with the list definition. Now you need to modify the List Instance to use the template you just created. Open the elements.xml file under the List Instance 1, the snap shot of default Elements.xml is as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_6291D309.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_6291D309.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_203EBAC6.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image019" alt="clip_image019" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_203EBAC6.png" height="86" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You need to change the TemplateType to the Type attribute you mentioned in the List Template, i.e. 10001. Also you can modify the list title, url etc. Also you can add initial data to the list instance so that the data will be inserted to the default list instance on feature activation.&lt;/p&gt;  &lt;p&gt;Place the below xml inside &amp;lt;ListInstance&amp;gt; tag for inserting initial data&lt;/p&gt;  &lt;h6&gt;&amp;lt;Data&amp;gt;   &lt;br&gt;&amp;nbsp; &amp;lt;Rows&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Row&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name="Title"&amp;gt;travel expense&amp;lt;/Field&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name="ExpenseDate"&amp;gt;01-01-2011&amp;lt;/Field&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name="Amount"&amp;gt;20.00&amp;lt;/Field&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Row&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Row&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name="Title"&amp;gt;your expense title&amp;lt;/Field&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name="ExpenseDate"&amp;gt;01-01-2011&amp;lt;/Field&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Field Name="Amount"&amp;gt;10.00&amp;lt;/Field&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Row&amp;gt;    &lt;br&gt;&amp;nbsp; &amp;lt;/Rows&amp;gt;    &lt;br&gt;&amp;lt;/Data&amp;gt;&lt;/h6&gt;  &lt;p&gt;See the snap shot of List Instance 1 after all changes were made.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_35D8F363.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_35D8F363.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_2E6D0DE9.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image020" alt="clip_image020" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_2E6D0DE9.png" height="232" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now we are ready to deploy the List defenition. Right click the project and click on deploy. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_44074686.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_44074686.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_0A18039A.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image021" alt="clip_image021" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_0A18039A.png" height="89" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you made everything correct, visual Studio will successfully deploy the list definition. Now you can find one list instance created in your SharePoint site. Open the list instance, you will find the data already inserted to it.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_7309825D.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_7309825D.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_48D9D475.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image023" alt="clip_image023" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_48D9D475.jpg" height="74" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When you create new item in SharePoint, you will find the expense template.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image025_05AE5648.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image025_05AE5648.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image025_thumb_1E5D7D8B.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image025" alt="clip_image025" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image025_thumb_1E5D7D8B.jpg" height="143" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It is easy to create List Definitions for SharePoint 2010 using Visual Studio 2010. Once you successfully tested your list definition project, you can package it to WSP file and deploy to multiple farms. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8030296" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio/default.aspx" /><category term="SharePoint 2007" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2007/default.aspx" /></entry><entry><title>Developing SharePoint 2010 features using Visual Studio 2010</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/10/27/developing-sharepoint-2010-features-using-visual-studio-2010.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/10/27/developing-sharepoint-2010-features-using-visual-studio-2010.aspx</id><published>2011-10-27T06:56:00Z</published><updated>2011-10-27T06:56:00Z</updated><content type="html">&lt;p&gt;Developers can extend SharePoint by creating new features. Using features developers can develop customizations and extensions that can be capable of automated deployment, management, un-installation and upgrading. SharePoint Feature allows developer to create a set of functionality to group into a component and allows administrators to add that functionality to the site/site collection. In addition to this, administrator can disable or uninstall the feature if they wish. With SharePoint 2010, it is possible to upgrade the feature to a new version. In this article I am going to demonstrate how to create a feature using SharePoint 2010.&lt;/p&gt;  &lt;p&gt;In SharePoint, each feature has its own folder. If your SharePoint is installed in default location, you can find all the features installed in the farm from the following location&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;All the features installed in SharePoint farm will have a corresponding folder here. Open any one folder you may see the files inside each folder. Let us examine the feature folder. For this purpose, I have opened the feature folder for HelpLibrary, that is available with default SharePoint installation. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_70792084.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_70792084.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_0F4F9463.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" alt="clip_image001" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_0F4F9463.png" height="78" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Every feature will have at least one file named Feature.XML called as feature manifest. A feature folder contains all the files required to implement the feature along with the feature manifest file. Other than feature manifest file, there can be other XML files and folders exists in the feature folder. Basically a feature is a set of XML documents, 1 feature manifest file and other elements manifest files. Features may also contain other types of files such as css files, aspx files, images etc. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Basically you can create a feature by using any text editor, but in this article I am going to demonstrate how to develop a feature using Visual Studio. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;For this demonstration, I am going to create a aspx page that just says “Welcome to My site” and add a menu item to the SharePoint that link to the page. In real time you may add web parts, list definitions, content types, list instances, image files etc to the feature. So let me start creating the feature. &lt;/p&gt;  &lt;p&gt;First you open Visual studio then select file -&amp;gt; New project, the new project dialog will appear. From the templates section, select Visual C# -&amp;gt; SharePoint -&amp;gt; 2010. Make sure the framework selected is .net framework 3.5. I named my project as “SayHelloFeature”, you are free to choose any name, and then choose a location for the project. Click ok once you are done. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_18C852D9.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_18C852D9.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_373293C2.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_373293C2.jpg" height="142" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;SharePoint customization wizard will appear now. Enter the url for the SharePoint portal where you want to do the debugging. When developing a feature using Visual Studio gives you an edge here. Visual Studio will do the packaging and deploying part as you might need to do this several times during development. In my case I need to deploy the feature to the entire farm, so I select the option deploy as farm solution. Click on the finish button once you are done.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_35EDFAE3.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_35EDFAE3.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_22609B42.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_22609B42.png" height="196" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now visual studio will create a minimal SharePoint project for you. See the snapshot of the project in the solution explorer.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_59C6AC70.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_59C6AC70.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_268A7307.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_268A7307.png" height="128" width="216" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Right click on the Features and select Add Feature. The solution explorer will look as follows&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_6C9B301A.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_6C9B301A.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_0B71A3F9.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image006" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_0B71A3F9.png" height="157" width="223" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Also Visual Studio will provide a dialog for updating the feature properties. You can provide a title and description for the feature and select the scope of the feature – means where it needs to be deployed. Since I want to deploy this feature in a site level, I select “Web” as the scope of my feature. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_037A0197.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_037A0197.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_5B675277.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image008" alt="clip_image008" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_5B675277.jpg" height="94" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can see the source of the application by clicking on the manifest link and you have the option to view and edit the feature.xml file directly.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_282B190E.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_282B190E.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_36A61533.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image009" alt="clip_image009" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_36A61533.png" height="208" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can set the version of the feature using the property dialog; the feature will be used by SharePoint 2010 when you upgrade the solution. &lt;/p&gt;  &lt;p&gt;From solution explorer, right click the project, select Add -&amp;gt; new Item, the new item dialog appears. Select module as the item template, enter a name, I just kept the name as Module1 (default one suggested by Visual Studio). Click Add once you are done. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_3A63BA03.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_3A63BA03.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_31FFE4AC.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image011" alt="clip_image011" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_31FFE4AC.jpg" height="142" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;From the solution explorer, the view of the project looks as below.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_17BF7B88.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_17BF7B88.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_48DEB628.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image012" alt="clip_image012" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_48DEB628.png" height="167" width="214" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When adding a new module, visual studio will automatically add an element manifest file and a Sample.txt file to the Module. Element manifest file is an xml file (Elements.xml – it can be any name as there is no restriction on the name, but if you change the name, make sure you update the feature definition with the corresponding name) that keeps track of all module files. In my feature, I don’t need sample.txt file, delete sample.txt by right click on it and select delete.&lt;/p&gt;  &lt;p&gt;Now you need to add an aspx page to the Module that says Hello to the user. To add a simple aspx file, there is no straight forward method available in VS2010, you can follow the below steps.&lt;/p&gt;  &lt;p&gt;(Visual Studio doesn’t provide a direct way to add an aspx page, so just choose text file as file type and then name it with .aspx extension)&lt;/p&gt;  &lt;p&gt;Right click module1 and the select Add -&amp;gt; New Item, then select General from the template, choose text-file as the template and name the file as Hello.aspx&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_27EB4381.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_27EB4381.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_0D3EA768.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image014" alt="clip_image014" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_0D3EA768.jpg" height="142" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you need to add the markup for the aspx page. You need to do this manually. Don’t forget to refer the default SharePoint assemblies. I have added the below markup to the hello.aspx page, You just need to make sure that the required content place holders are there in the new page, all the other content you are free to make it your own.&lt;/p&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;%@ Page MasterPageFile="~masterurl/default.master" meta:progid="SharePoint.WebPartPage.Document" %&amp;gt;     &lt;br&gt;&amp;lt;asp:Content ID="title" runat="server" ContentPlaceHolderID="PlaceHolderPageTitle"&amp;gt;      &lt;br&gt;&amp;nbsp;&amp;nbsp; Saying Hello      &lt;br&gt;&amp;lt;/asp:Content&amp;gt;      &lt;br&gt;&amp;lt;asp:Content ID="addhead" runat="server" ContentPlaceHolderID="PlaceHolderAdditionalPageHead"&amp;gt;      &lt;br&gt;&amp;lt;/asp:Content&amp;gt;      &lt;br&gt;&amp;lt;asp:Content ID="Content1" runat="server" ContentPlaceHolderID="PlaceHolderMain"&amp;gt;      &lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;lt;h3&amp;gt;Hello, Welcome to My Site&amp;lt;/h3&amp;gt;      &lt;br&gt;&amp;lt;/asp:Content&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now we are done with the aspx page. For the demonstration purpose, I am going to add a menu item that links to the newly created page. For such purposes, SharePoint provides custom action using which you can add menu items to SharePoint.&lt;/p&gt;  &lt;p&gt;From the solution explorer, right click the project, select Add -&amp;gt; New Item. In the template list, you will not find a template with the name custom action, so select empty element; - You can use empty element when none of the templates matches a particular type of item.&lt;/p&gt;  &lt;p&gt;For understanding more about custom actions read the below 2 posts&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms460194.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms460194.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms460194.aspx&lt;/a&gt;      &lt;br&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb802730.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb802730.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb802730.aspx&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In the elements.xml under new empty element just added, paste the below xml&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;CustomAction Id="SiteActionsToolbar" GroupId="SiteActions"      &lt;br&gt;Location="Microsoft.SharePoint.StandardMenu" Sequence="100" Title="Say Hello"      &lt;br&gt;Description="A page saying hello"&amp;gt;&amp;lt;UrlAction Url="~site/SitePages/Hello.aspx"/&amp;gt;      &lt;br&gt;&amp;lt;/CustomAction&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Save the file, now you are done with the custom action. Let us examine the feature file. Go to the feature page and make sure feature contains all the items you have added.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_0BFA0E89.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image016_0BFA0E89.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_43CC52AC.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image016" alt="clip_image016" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image016_thumb_43CC52AC.jpg" height="117" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now the solution is ready to deploy. From solution explorer, right click the project and click deploy. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_10901943.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_10901943.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_3685C999.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image017" alt="clip_image017" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_3685C999.png" height="114" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now visual studio will deploy the feature to the farm and activate it. Once deployed, go to the features folder under 14 hive and you will see your feature folder there. See the snapshot of the SayHello feature folder, once deployed. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_276EEABF.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_276EEABF.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_129CF23F.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image018" alt="clip_image018" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_129CF23F.png" height="96" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Once the feature is activated, You can see the menu item is added to the Site Actions menu of your site. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_4996D078.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_4996D078.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_48523799.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image019" alt="clip_image019" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_48523799.png" height="244" width="139" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click on the Say Hello link, you will be redirected to the page. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_74FAF172.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_74FAF172.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_33803F19.png" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image020" alt="clip_image020" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_33803F19.png" height="183" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Visual Studio makes it easy for developers to build features for SharePoint 2010. Developers have complete control over each components of the feature. The one click deployment saves lot of developer time as they should not worry about the administrative process involved in the installation process. In addition to all these, Visual Studio will package your solution as WSP file, in single click so that you can package your solution and deploy it to production servers. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8014831" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="ASP.Net" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net/default.aspx" /><category term="Sharepoint" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio/default.aspx" /><category term="SharePoint 2007" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2007/default.aspx" /></entry><entry><title>Determine the version of MOSS 2007 installed</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/09/22/determine-the-version-of-moss-2007-installed.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/09/22/determine-the-version-of-moss-2007-installed.aspx</id><published>2011-09-22T05:05:00Z</published><updated>2011-09-22T05:05:00Z</updated><content type="html">&lt;p&gt;Recently I came across with an assignment to upgrade MOSS 2007 to SharePoint 2010. MOSS 2007 was already installed but no documentation was available. I asked the system administrator and he had no clue as he just joined the company. I need to know the service pack installed in the MOSS 2007 farm and I thought of document this as it may help others.&lt;/p&gt;  &lt;p&gt;First browse to the central administration on the MOSS 2007 Farm&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_67322840.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_67322840.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_36DB2DBD.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" alt="clip_image002" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_36DB2DBD.jpg" height="131" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click on Operations tab, you will reach the following screen&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_3934AFBB.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_3934AFBB.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_0BD319EB.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_0BD319EB.jpg" height="118" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Under topology and services, click on “Servers in farm”&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_22B1EB67.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_22B1EB67.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_2094EC9E.jpg" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image006" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_2094EC9E.jpg" height="125" width="244" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the highlighted portion that is the version number. Now you need to find out what is that version, you can use the following table for reference. As it is indicated, my server farm already equipped with SP2.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;         &lt;tr&gt;           &lt;td valign="top" width="319"&gt;             &lt;p&gt;Version Number&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="319"&gt;             &lt;p&gt;Description&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="319"&gt;             &lt;p&gt;First Release Version (RTM)&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="319"&gt;             &lt;p&gt;12.0.0.4518&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="319"&gt;             &lt;p&gt;Service Pack 1&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="319"&gt;             &lt;p&gt;12.0.0.6219&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="319"&gt;             &lt;p&gt;Service Pack 2&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="319"&gt;             &lt;p&gt;12.0.0.6421&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;       &lt;/tbody&gt;&lt;/table&gt;   &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you install patches, the version number will vary, but it will be sequential, once you install SP1, the version number will be between 12.0.0.6219 and 12.0.0.6421. For e.g. if you have the version number 12.0.0.6301, then you can assume it is service pack 1 with some patches installed.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7960933" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /><category term="SharePoint 2007" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2007/default.aspx" /></entry><entry><title>Site Map Provider using custom business objects</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/07/21/site-map-provider-using-custom-business-objects.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/07/21/site-map-provider-using-custom-business-objects.aspx</id><published>2011-07-21T05:06:00Z</published><updated>2011-07-21T05:06:00Z</updated><content type="html">&lt;p&gt;Recently one of the project I was in a situation to build navigation for line of business data, the existing system available was fully designed as object oriented and it connects with some database other than SQL server. While thinking about showing navigation controls to the user, it was not a good idea to drill through objects as it takes lot of resources and more number of connections. So I decided to use a custom SiteMap provider that uses LOB objects to create navigation. In this article I am going to summarize the major steps I went through. &lt;/p&gt;  &lt;p&gt;ASP.Net 2.0 introduced the provider model for many things such as membership, roles, navigation etc and with ASP.Net 4.0 the support for the provider model continues. For enterprises the default behavior may not be enough to address the business requirements. The provider model is powerful as you can write your own providers that connect to various data sources for storing and retrieving data. This article discusses how you can create a custom SiteMap Provider that generate SiteMap navigation from objects. &lt;/p&gt;  &lt;p&gt;ASP.Net ships with a default sitemap provider that uses an XML SiteMap file (web.sitemap) to generate the navigation. One of the most common requirements is that you need to generate your own sitemap from the SQL Server database or from custom Objects. Creating Sitemap provider from SQL server database is not in the scope of this article, but the steps including in creating a Custom SQL SiteMap provider will be identical to this article. &lt;/p&gt;  &lt;p&gt;For the sake of demonstration, I have created a class Person. The following are the properties of class Person&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;id – for the person     &lt;br&gt;name – name of the person      &lt;br&gt;description – description about the person      &lt;br&gt;parent – object of type Person, that represents the direct parent of this person&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Notice the parent object inside the Person class, this makes the Person object extendable to any level. I have created the following methods for the Person class.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public static Person GetRoot() – static method, that returns the top level parent, &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;public List&amp;lt;Person&amp;gt; GetFirstLevelChildren() – retuns the list of all Person objects that comes directly under the current Person&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;By using the above two methods, one can easily drill through the entire objects easily, to navigate through all the available person objects, first you need to call the GetTopPerson and then call GetFirstLevelChildren for each person object in a nested manner. In real life, it may not be this straight forward when working with complex data structures. Now let us create a sitemap provider for the Person class. To create a custom navigation provider, you need to create a class that extends StaticSiteMapProvider. I named the SiteMap provider class as PersonSiteMapProvider. The definition of the class is as follows. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public class PersonSiteMapProvider : StaticSiteMapProvider     &lt;br&gt;{      &lt;br&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When you extend the StaticSiteMapProvider class, you must override the following two methods&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;GetRootNodeCore – returns the rootNode for the sitemap&lt;/p&gt;    &lt;p&gt;BuildSiteMap() – this method loads the sitemap to the memory. In this method, you need to traverse through LOB data structure (in our case it is Person objects) and build the sitemap accordingly.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In addition to this, I have created a private variable in the PersonSiteMapProvider class to keep the track of the rootNode, and initialize it as null. In the BuildSiteMap method, if you find rootNode as null, that means, you need to traverse through the object structure and create the sitemap otherwise, you can assume sitemap is already built.&amp;nbsp; The sitemap provider is a staic class, once you assign rootNode once, the value will be available throughout your application. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;private SiteMapNode rootNode = null;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The GetRootNodeCore method implementation is as follows. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;protected override SiteMapNode GetRootNodeCore()     &lt;br&gt;{      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return rootNode;      &lt;br&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Let us see what is inside BuildSiteMap method. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public override SiteMapNode BuildSiteMap()     &lt;br&gt;{      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lock (this)      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (rootNode == null )      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Person root = Person.GetRoot();      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rootNode = new SiteMapNode(this, root.id.ToString(), "/person.aspx?id=" + root.id.ToString(), root.name);      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Person p in root.GetFirstLevelChildren())       &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddNode(GetPersonAsNode(p, rootNode), rootNode);      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return rootNode;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The code is self-explanatory. See the lock method, since the implemented provider is static, you need to make the variable rootNode thread safe, lock method will make the code thread safe. First it will call get the root person by calling the Person.GetRoot() method, it will add it as the rootNode. Now for each children of Person, it will call the method GetPersonNode, that recursively build all the sub nodes for each person. Let us evaluate the code for GetPersonAsNode.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;private SiteMapNode GetPersonAsNode(Person p, SiteMapNode tmpRoot)     &lt;br&gt;{      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SiteMapNode thisNode = new SiteMapNode(this, p.id.ToString(), "/person.aspx?id" + p.id.ToString(), p.name);      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (Person p1 in p.GetFirstLevelChildren())      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SiteMapNode childNode = GetPersonAsNode(p1, thisNode);      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddNode(childNode, thisNode);      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return thisNode;      &lt;br&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The GetPersonAsNode first add the given person object to the node and if the person object has any children directly under it, then build the node tree for child persons by calling the same method recursively, and then return the node representation of the person. &lt;/p&gt;  &lt;p&gt;That’s it. Now you have created a sitemap provider for the navigation of your person objects. Now you need to use this sitemap provider in your aspx pages. To use your custom sitemap provider, first you need to add the provider in the web.config. &lt;/p&gt;  &lt;p&gt;See the below code that adds PersonSiteMapProvider in web.config&lt;/p&gt;  &lt;p&gt;&amp;lt;siteMap&amp;gt;   &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;providers&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="PersonSiteMapProvider" type="cTest.PersonSiteMapProvider"/&amp;gt;    &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/providers&amp;gt;    &lt;br&gt;&amp;lt;/siteMap&amp;gt;&lt;/p&gt;  &lt;p&gt;** In the type name, you need to use the fully qualified name for the SiteMapProvider class. In this case, the namespace I have used is cTest. Now you can use the PersonSiteMapProvider in the page. Create a new aspx page and then drag and drop an aspmenu and a sitemapprovider to the page and configure them to use the PersonSiteMapProvider. &lt;/p&gt;  &lt;p&gt;See the markup for the sitemap provider in my aspx page.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"&amp;gt;&amp;lt;/asp:Menu&amp;gt;     &lt;br&gt;      &lt;br&gt;&amp;lt;asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" SiteMapProvider="PersonSiteMapProvider" /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now run the page, the aspmenu control will display the sitemap contained in your objects. See the sample output&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_136F7FB8.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_136F7FB8.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_5F5AE064.png" style="border: 0px none; display: inline;" title="clip_image001" alt="clip_image001" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_5F5AE064.png" width="235" border="0" height="138"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;By using the sitemap provider, the application will improve its performance. The sitemap provider caches the data in memory. So instead of hitting your back end data store each time to retrieve the sitemap data, your application will only hit the backend data store for the first time and for subsequent requests, it will reuse the SiteMap node from from memory.&lt;/p&gt;  &lt;p&gt;References&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178431%28v=VS.80%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms178431%28v=VS.80%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178431%28v=VS.80%29.aspx&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7877793" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="ASP.Net" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net/default.aspx" /><category term="ASP.Net 4" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net+4/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/sreejukg/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/sreejukg/archive/tags/.NET/default.aspx" /></entry><entry><title>Configure Forms based authentication in SharePoint 2010</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/06/19/configure-form-authentication-in-sharepoint-2010.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/06/19/configure-form-authentication-in-sharepoint-2010.aspx</id><published>2011-06-19T06:58:00Z</published><updated>2011-06-19T06:58:00Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;Configuring form authentication is a straight forward task in SharePoint. Mostly public facing websites built on SharePoint requires form based authentication. Recently, one of the WCM implementation where I was included in the project team required registration system. Any internet user can register to the site and the site offering them some membership specific functionalities once the user logged in. Since the registration open for all, I don’t want to store all those users in Active Directory. I have decided to use Forms based authentication for those users. This is a typical scenario of form authentication in SharePoint implementation.&lt;/p&gt;  &lt;h3&gt;To implement form authentication you require the following&lt;/h3&gt;  &lt;ol&gt;   &lt;li&gt;A data store where you are storing the users – technically this can be active directory, SQL server database, LDAP etc. Form authentication will redirect the user to the login page, if the request is not authenticated. In the login page, there will be controls that validate the user inputs against the configured data store. In this article, I am going to use SQL server database with ASP.Net membership API’s to configure form based authentication in SharePoint 2010.      &lt;br&gt;      &lt;br&gt;This article assumes that you have SQL membership database available. I already configured the membership and roles database using aspnet_regsql command. If you want to know how to configure membership database using aspnet_regsql command, read the below blog post. &lt;a href="http://weblogs.asp.net/sreejukg/archive/2011/06/16/usage-of-aspnet-regsql-exe-in-asp-net-4.aspx" mce_href="http://weblogs.asp.net/sreejukg/archive/2011/06/16/usage-of-aspnet-regsql-exe-in-asp-net-4.aspx"&gt;http://weblogs.asp.net/sreejukg/archive/2011/06/16/usage-of-aspnet-regsql-exe-in-asp-net-4.aspx&lt;/a&gt;       &lt;blockquote&gt;       &lt;p&gt;The snapshot of the database after implementing membership and role manager is as follows. I have used the database name “aspnetdb_claim”. &lt;/p&gt;     &lt;/blockquote&gt;      &lt;blockquote&gt;       &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_0B91DF44.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_0B91DF44.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_2DB9C4FD.png" style="border-width: 0px; display: inline;" title="clip_image001" alt="clip_image001" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_2DB9C4FD.png" width="231" border="0" height="244"&gt;&lt;/a&gt;&lt;/p&gt;     &lt;/blockquote&gt;      &lt;blockquote&gt;       &lt;p&gt;Make sure you have created the database and make sure your database contains tables and stored procedures for membership. &lt;/p&gt;     &lt;/blockquote&gt;   &lt;/li&gt;    &lt;li&gt;Create a web application with claims based authentication.      &lt;br&gt;      &lt;br&gt;This article assumes you already created a web application using claims based authentication. If you want to enable forms based authentication in SharePoint 2010, you must enable claims based authentication. Read this post for creating a web application using claims based authentication. &lt;a href="http://weblogs.asp.net/sreejukg/archive/2011/06/15/create-a-web-application-in-sharepoint-2010-using-claims-based-authentication.aspx" mce_href="http://weblogs.asp.net/sreejukg/archive/2011/06/15/create-a-web-application-in-sharepoint-2010-using-claims-based-authentication.aspx"&gt;       &lt;br&gt;http://weblogs.asp.net/sreejukg/archive/2011/06/15/create-a-web-application-in-sharepoint-2010-using-claims-based-authentication.aspx&lt;/a&gt;&amp;nbsp; &lt;br&gt;      &lt;br&gt;You make sure, you have selected enable form authentication, and then selected Membership provider and Role manager name. To make sure you are done with the configuration, navigate to central administration website, from central administration, navigate to the Web Applications page, select the web application and click on &lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_31E39CC2.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_31E39CC2.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_1083F726.jpg" style="border-width: 0px; display: inline;" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_1083F726.jpg" width="41" border="0" height="34"&gt;&lt;/a&gt; icon, you will see the authentication providers for the current web application. Go to the section Claims authentication types, and make sure you have enabled forms based authentication.       &lt;br&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_3A83F54E.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_3A83F54E.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_5FA13FBA.png" style="border: 0px none; display: inline;" title="clip_image004" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_5FA13FBA.png" width="290" border="0" height="271"&gt;&lt;/a&gt;      &lt;br&gt;As mentioned in the snapshot, I have named the membership provider as &lt;b&gt;SPFormAuthMembership&lt;/b&gt; and role manager as &lt;b&gt;SPFormAuthRoleManager&lt;/b&gt;. You can choose your own names as you need. &lt;/li&gt;    &lt;li&gt;Modify the configuration files(Web.Config) to enable form authentication     &lt;br&gt;      &lt;br&gt;There are three applications that needs to be configured to support form authentication. The following are those applications.&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Central Administration       &lt;br&gt;        &lt;br&gt;If you want to assign permissions to web application using the credentials from form authentication, you need to update Central Administration configuration. If you do not want to access form authentication credentials from Central Administration, just leave this step.&amp;nbsp; &lt;br&gt;&lt;/li&gt;      &lt;li&gt;STS service application       &lt;br&gt;        &lt;br&gt;Security Token service is the service application that issues security token when users are logging in. You need to modify the configuration of STS application to make sure users are able to login. To find the STS application, follow the following steps&lt;/li&gt;      &lt;ul&gt;       &lt;li&gt;Go to the IIS Manager&lt;/li&gt;        &lt;li&gt;Expand the sites Node, you will see SharePoint Web Services          &lt;br&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_525AB6A7.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_525AB6A7.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_7C5AB4CF.png" style="border-width: 0px; display: inline;" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_7C5AB4CF.png" width="228" border="0" height="187"&gt;&lt;/a&gt;&lt;/li&gt;        &lt;li&gt;Expand SharePoint Web Services, you can see SecurityTokenServiceApplication          &lt;br&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_0F9B6B6F.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_0F9B6B6F.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_66B05665.png" style="border-width: 0px; display: inline;" title="clip_image006" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_66B05665.png" width="226" border="0" height="244"&gt;&lt;/a&gt;&lt;/li&gt;        &lt;li&gt;Right click SecuritytokenServiceApplication and click explore, it will open the corresponding file system. By default, the path for STS is          &lt;br&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebServices\SecurityToken           &lt;br&gt;You need to modify the configuration file available in the mentioned location.&lt;/li&gt;     &lt;/ul&gt;      &lt;li&gt;The web application that needs to be enabled with form authentication.&lt;/li&gt;      &lt;li&gt;You need to modify the configuration of your web application to make sure your web application identifies users from the form authentication. &lt;/li&gt;   &lt;/ul&gt; &lt;/ol&gt;  &lt;p&gt;&amp;nbsp;&lt;/p&gt;  &lt;p&gt;Based on the above, I am going to modify the web configuration. At end of each step, I have mentioned the expected output. I recommend you to go step by step and after each step, make sure the configuration changes are working as expected. If you do everything all together, and test your application at the end, you may face difficulties in troubleshooting the configuration errors.&lt;/p&gt;  &lt;h3&gt;Modifications for Central Administration Web.Config&lt;/h3&gt;  &lt;p&gt;Open the web.config for the Central administration in a text editor. I always prefer Visual Studio, for editing web.config. In most cases, the path of the web.config for the central administration website is as follows&lt;/p&gt;  &lt;p&gt;C:\inetpub\wwwroot\wss\VirtualDirectories\&amp;lt;port number&amp;gt;&lt;/p&gt;  &lt;p&gt;Make sure you keep a backup copy of the web.config, before editing it.&lt;/p&gt;  &lt;p&gt;Let me summarize what we are going to do with Central Administration web.config. First I am going to add a connection string that points to the form authentication database, that I created as mentioned in previous steps. Then I need to add a membership provider and a role manager with the corresponding connectionstring. Then I need to update the peoplepickerwildcards section to make sure the users are appearing in search results. &lt;/p&gt;  &lt;p&gt;By default there is no connection string available in the web.config of Central Administration. Add a connection string just after the configsections element. The below is the connection string I have used all over the article. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;add name="FormAuthConnString" connectionString="Initial Catalog=&lt;b&gt;yourdatabasename&lt;/b&gt;;data source=databaseservername;Integrated Security=SSPI;" /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Once you added the connection string, the web.config look similar to &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_3D590E67.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_3D590E67.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_5C2F8245.jpg" style="border-width: 0px; display: inline;" title="clip_image008" alt="clip_image008" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_5C2F8245.jpg" width="244" border="0" height="40"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now add membership provider to the code. In web.config for CA, there will be &amp;lt;membership&amp;gt; tag, search for it. You will find membership and role manager under the &amp;lt;system.web&amp;gt; element. Under the membership providers section add the below code…&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;add name="&lt;b&gt;SPFormAuthMembership&lt;/b&gt;" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="&lt;b&gt;FormAuthApplication&lt;/b&gt;" connectionStringName="&lt;b&gt;FormAuthConnString&lt;/b&gt;" /&amp;gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After adding memberhip element, see the snapshot of the web.config. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_5AEAE966.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_5AEAE966.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_2E61B980.jpg" style="border-width: 0px; display: inline;" title="clip_image010" alt="clip_image010" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_2E61B980.jpg" width="244" border="0" height="34"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you need to add role manager element to the web.config. Insider providers element under rolemanager, add the below code.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;add name="&lt;b&gt;SPFormAuthRoleManager&lt;/b&gt;" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="&lt;b&gt;FormAuthApplication&lt;/b&gt;" connectionStringName="&lt;b&gt;FormAuthConnString&lt;/b&gt;" /&amp;gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After adding, your role manager will look similar to the following.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_2D1D20A1.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image012_2D1D20A1.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_0BBD7B05.jpg" style="border-width: 0px; display: inline;" title="clip_image012" alt="clip_image012" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image012_thumb_0BBD7B05.jpg" width="244" border="0" height="34"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As a last step, you need to update the people picker wildcard element in web.config, so that the users from your membership provider are available for browsing in Central Administration. &lt;/p&gt;  &lt;p&gt;Search for PeoplePickerWildcards in the web.config, add the following inside the &amp;lt;PeoplePickerWildcards&amp;gt; tag. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;add key="SPFormAuthMembership" value="%" /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After adding this element, your web.config will look like&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_5C8B8F6D.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_5C8B8F6D.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_496A62C1.png" style="border-width: 0px; display: inline;" title="clip_image013" alt="clip_image013" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_496A62C1.png" width="244" border="0" height="52"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After completing these steps, you can browse the users available in the SQL server database from central administration website. Go to the site collection administrator’s page from central administration. Select the site collection you have created for form authentication. Click on the people picker icon&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_6840D69F.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image014_6840D69F.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_4AEB7ED5.png" style="border-width: 0px; display: inline;" title="clip_image014" alt="clip_image014" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image014_thumb_4AEB7ED5.png" width="26" border="0" height="25"&gt;&lt;/a&gt;, choose Forms Auth and click on the search icon, you will see the users listed from the SQL server database. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_17AF456C.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_17AF456C.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_3CCC8FD8.png" style="border-width: 0px; display: inline;" title="clip_image015" alt="clip_image015" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_3CCC8FD8.png" width="244" border="0" height="158"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Once you complete these steps, make sure the users are available for browsing from central administration website. If you are unable to find the users, there must be some errors in the configuration, check windows event logs to find related errors and fix them. &lt;/p&gt;  &lt;h3&gt;Change the web.config for STS application&lt;/h3&gt;  &lt;p&gt;Open the web.config for STS application in text editor. By default, STS web.config does not have system.Web or connectionstrings section. Just after the System.Webserver element, add the following code. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;connectionStrings&amp;gt;      &lt;br&gt;&amp;lt;add name="FormAuthConnString" connectionString="Initial Catalog=aspnetdb_claim;data source=sp2010_db;Integrated Security=SSPI;" /&amp;gt;       &lt;br&gt;&amp;lt;/connectionStrings&amp;gt;       &lt;br&gt;&amp;lt;system.web&amp;gt;       &lt;br&gt;&amp;lt;roleManager enabled="true" cacheRolesInCookie="false" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" createPersistentCookie="false" maxCachedResults="25"&amp;gt;       &lt;br&gt;&amp;lt;providers&amp;gt;&lt;/p&gt;    &lt;p&gt;&amp;lt;add name="SPFormAuthRoleManager" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="FormAuthApplication" connectionStringName="FormAuthConnString" /&amp;gt; &amp;lt;/providers&amp;gt;      &lt;br&gt;&amp;lt;/roleManager&amp;gt;       &lt;br&gt;&amp;lt;membership userIsOnlineTimeWindow="15" hashAlgorithmType=""&amp;gt;       &lt;br&gt;&amp;lt;providers&amp;gt;       &lt;br&gt;&amp;lt;add name="SPFormAuthMembership" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="FormAuthApplication" connectionStringName="FormAuthConnString" /&amp;gt;       &lt;br&gt;&amp;lt;/providers&amp;gt;       &lt;br&gt;&amp;lt;/membership&amp;gt;       &lt;br&gt;&amp;lt;/system.web&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the snapshot of the web.config after adding the required elements. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_3468BA81.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_3468BA81.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_32B7EEAD.jpg" style="border-width: 0px; display: inline;" title="clip_image017" alt="clip_image017" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_32B7EEAD.jpg" width="244" border="0" height="79"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After adding this, you should be able to login using the credentials from SQL server. Try assigning a user as primary/secondary administrator for your site collection from Central Administration and login to your site using form authentication. If you made everything correct, you should be able to login. This means you have successfully completed configuration of STS&lt;/p&gt;  &lt;h3&gt;Configuration of Web Application for Form Authentication&lt;/h3&gt;  &lt;p&gt;As a last step, you need to modify the web.config of the form authentication web application. Once you have done this, you should be able to grant permissions to users stored in the membership database. &lt;/p&gt;  &lt;p&gt;Open the Web.config of the web application you created for form authentication. You can find the web.config for the application under the path &lt;/p&gt;  &lt;p&gt;C:\inetpub\wwwroot\wss\VirtualDirectories\&amp;lt;port number&amp;gt;&lt;/p&gt;  &lt;p&gt;Basically you need to add connection string, membership provider, role manager and update the people picker wild card configuration. &lt;/p&gt;  &lt;p&gt;Add the connection string (same as the one you added to the web.config in Central Administration). See the screenshot after the connection string has added.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_7F0F824E.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image019_7F0F824E.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_76ABACF7.jpg" style="border-width: 0px; display: inline;" title="clip_image019" alt="clip_image019" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image019_thumb_76ABACF7.jpg" width="244" border="0" height="59"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Search for &amp;lt;membership&amp;gt; in the web.config, you will find this inside system.web element. There will be other providers already available there. You add your form authentication membership provider (similar to the one added to Central Administration web.config) to the provider element under membership. Find the snapshot of membership configuration as follows. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_3FEE51F3.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image021_3FEE51F3.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_3A33384D.jpg" style="border-width: 0px; display: inline;" title="clip_image021" alt="clip_image021" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image021_thumb_3A33384D.jpg" width="244" border="0" height="31"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Search for &amp;lt;roleManager&amp;gt; element in web.config, add the new provider name under providers section of the roleManager element. See the snapshot of web.config after new provider added. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_51EA6FB3.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image023_51EA6FB3.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_69A1A719.jpg" style="border-width: 0px; display: inline;" title="clip_image023" alt="clip_image023" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image023_thumb_69A1A719.jpg" width="244" border="0" height="34"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you need to configure the peoplepickerwildcard configuration in web.config. As I specified earlier, this is to make sure, you can locate the users by entering a part of their username. Add the following line under the &amp;lt;PeoplePickerWildcards&amp;gt; element in web.config. &lt;/p&gt;  &lt;p&gt;See the screenshot of the peoplePickerWildcards element after the element has been added. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image024_0158DE80.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image024_0158DE80.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image024_thumb_553BE18E.png" style="border-width: 0px; display: inline;" title="clip_image024" alt="clip_image024" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image024_thumb_553BE18E.png" width="244" border="0" height="56"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now you have completed all the setup for form authentication. Navigate to the web application.&lt;/p&gt;  &lt;p&gt;From the site actions -&amp;gt; site settings -&amp;gt; go to peope and groups&lt;/p&gt;  &lt;p&gt;Click on new -&amp;gt; add users, it will popup the people picker dialog. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image026_7ECFACC1.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image026_7ECFACC1.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image026_thumb_1686E428.jpg" style="border-width: 0px; display: inline;" title="clip_image026" alt="clip_image026" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image026_thumb_1686E428.jpg" width="244" border="0" height="75"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click on the &lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image0141_557864C3.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image0141_557864C3.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image0141_thumb_50297E12.png" style="border-width: 0px; display: inline;" title="clip_image014[1]" alt="clip_image014[1]" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image0141_thumb_50297E12.png" width="26" border="0" height="25"&gt;&lt;/a&gt; icon, select Form Auth, enter a username in the search textbox, and click on search icon. See the screenshot of admin search when I tried searching the users&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image028_19D85603.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image028_19D85603.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image028_thumb_384296EC.jpg" style="border-width: 0px; display: inline;" title="clip_image028" alt="clip_image028" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image028_thumb_384296EC.jpg" width="244" border="0" height="221"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If it displays the user, it means you are done with the configuration. If you add users to the form authentication database, the users will be able to access SharePoint portal as normal.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7834175" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/sreejukg/archive/tags/.NET/default.aspx" /><category term="Forms Authentication" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Forms+Authentication/default.aspx" /></entry><entry><title>WalkThrough: aspnet_regsql.exe in ASP.Net 4</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/06/16/usage-of-aspnet-regsql-exe-in-asp-net-4.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/06/16/usage-of-aspnet-regsql-exe-in-asp-net-4.aspx</id><published>2011-06-16T07:48:00Z</published><updated>2011-06-16T07:48:00Z</updated><content type="html">&lt;p&gt;ASP.Net has the built-in support for Membership. Using this, you can securely store and validate user credentials. By using Membership along with Roles and Profiles you can build powerful applications. ASP.Net has a set of classes that allows you to access the Membership and Roles functionality. You can get complete reference of these classes from the below link.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/91f66yxt.aspx" mce_href="http://msdn.microsoft.com/en-us/library/91f66yxt.aspx"&gt;http://msdn.microsoft.com/en-us/library/91f66yxt.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Asp.Net membership stores the membership data in the SQL Server database. So in order to start working on a project that uses the membership, you need to install the membership schema (nothing but, some tables and stored procedures) in your database. Once you have the database schema available, from your application, you can manage the users/roles/profiles from your code. &lt;/p&gt;  &lt;p&gt;In this walkthrough, I am going to create a database schema for asp.net membership. Before doing the same, Make sure you have ASP.Net installed.&lt;/p&gt;  &lt;p&gt;First create a database for installing membership database schema. In this walkthrough, I am assuming you have created a database named “MembershipDB”. The snapshot of the database in management studio is as follows. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_0C74D959.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image001_0C74D959.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_666F0335.png" style="border: 0px none; display: inline;" title="clip_image001" alt="clip_image001" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image001_thumb_666F0335.png" width="229" border="0" height="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;As you notice there are no tables and stored procedures available as I just created this DB. &lt;/p&gt;  &lt;p&gt;There is a powerful tool shipped with ASP.Net to create membership schema in your database; “aspnet_regsql.exe”. This tool is located at &lt;b&gt;&amp;lt;windowsDirectory&amp;gt;\Microsoft.Net\Framework\&amp;lt;version&lt;/b&gt;&amp;gt;\ folder. If Windows installed in C drive, you can find the path for the tool in .Net 4 as below.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;C:\Windows\Microsoft.NET\Framework64\v4.0.30319&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the snapshot of the folder in windows explorer&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_2192B934.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_2192B934.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_0C9110F4.jpg" style="border: 0px none; display: inline;" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_0C9110F4.jpg" width="244" border="0" height="79"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Open a command prompt and change the directory to the mentioned folder. Type aspnet_regsql in the command prompt and press enter.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_1C03FCF6.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_1C03FCF6.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_1E10D5F2.jpg" style="border: 0px none; display: inline;" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_1E10D5F2.jpg" width="244" border="0" height="42"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This will open the SQL registration wizard. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_550AB42B.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_550AB42B.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_60904B9D.png" style="border: 0px none; display: inline;" title="clip_image006" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_60904B9D.png" width="244" border="0" height="189"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click next &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_4C96B907.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_4C96B907.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_5A394F42.png" style="border: 0px none; display: inline;" title="clip_image007" alt="clip_image007" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_5A394F42.png" width="244" border="0" height="186"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Make sure configure SQL server for application services has been selected. Now you need to select the database to install the membership schema&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_775EF74C.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_775EF74C.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_316DC42C.png" style="border: 0px none; display: inline;" title="clip_image008" alt="clip_image008" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_316DC42C.png" width="244" border="0" height="190"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Select your database and click next. A confirmation screen will appear.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_4FD80515.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_4FD80515.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_008B0CC1.png" style="border: 0px none; display: inline;" title="clip_image009" alt="clip_image009" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_008B0CC1.png" width="244" border="0" height="190"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click next.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_3F105A67.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image010_3F105A67.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_3D5F8E93.png" style="border: 0px none; display: inline;" title="clip_image010" alt="clip_image010" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image010_thumb_3D5F8E93.png" width="244" border="0" height="190"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Click finish to exist the wizard.&lt;/p&gt;  &lt;p&gt;Check in the database, you will see, Membership tables and stored procedures are created. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_54AA9304.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_54AA9304.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_663A7DCF.png" style="border: 0px none; display: inline;" title="clip_image011" alt="clip_image011" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_663A7DCF.png" width="210" border="0" height="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The wizard is useful and easy. But it has some disadvantages, you cannot install individual features, for example, if you want to install only Membership and Roles, you cannot achieve this with the wizard. Also normally administrators prefer command line. aspnet_regsql can be executed in command line mode. The following are the important parameters supported by aspnet_regsql tool&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;table border="1" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;         &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;Parameter&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;Description&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;-E&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;Authenticate with current windows credentials. &lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;-S&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;SQL Server instance. &lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;-d&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;Database name, where the membership to be installed. &lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;-C&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;Connection string, in this case you doesn’t need to specify server instance separately&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;-A all|m|r|p|c|w&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;A denotes add, other keys can be used in combination. For e.g. if you want to install membership and roles, specify&lt;/p&gt;              &lt;p&gt;-A mr&lt;/p&gt;              &lt;p&gt;The supported options are &lt;/p&gt;              &lt;p&gt;all – All the available features&lt;/p&gt;              &lt;p&gt;m – Membership&lt;/p&gt;              &lt;p&gt;r – roles&lt;/p&gt;              &lt;p&gt;p – profiles&lt;/p&gt;              &lt;p&gt;c- personalization&lt;/p&gt;              &lt;p&gt;w – SQL web events&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;-R all|m|r|p|c|w&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;Remove a particular feature.&lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;          &lt;tr&gt;           &lt;td valign="top" width="229"&gt;             &lt;p&gt;-?&lt;/p&gt;           &lt;/td&gt;            &lt;td valign="top" width="409"&gt;             &lt;p&gt;List all the options. &lt;/p&gt;           &lt;/td&gt;         &lt;/tr&gt;       &lt;/tbody&gt;&lt;/table&gt;    &lt;/blockquote&gt;  &lt;p&gt;Find some examples. &lt;/p&gt;  &lt;p&gt;1. Remove all the services installed in a SQL instance&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Command: aspnet_regsql.exe -E -S sp2010_db -R all -d MembershipDB&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_04388BC4.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image013_04388BC4.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_36DC0AA1.jpg" style="border: 0px none; display: inline;" title="clip_image013" alt="clip_image013" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image013_thumb_36DC0AA1.jpg" width="244" border="0" height="94"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;The command will ask you a confirmation, you need to enter y for confirming. If you check your database now, you will see the tables and stored procedures are removed from database. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;2. Add membership and roles &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;aspnet_regsql.exe -E -S sp2010_db -A mr -d MembershipDB     &lt;br&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_741CBF68.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image015_741CBF68.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_6B4CB71C.jpg" style="border: 0px none; display: inline;" title="clip_image015" alt="clip_image015" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image015_thumb_6B4CB71C.jpg" width="244" border="0" height="65"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;Check the database and you will see only membership and roles specific schema is installed in db. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;3. List all the available options for the command&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;aspnet_regsql.exe -?     &lt;br&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_71275AB5.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image017_71275AB5.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_2416EB1D.jpg" style="border: 0px none; display: inline;" title="clip_image017" alt="clip_image017" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image017_thumb_2416EB1D.jpg" width="244" border="0" height="105"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Be noted that the parameters are case sensitive. aspnet_regsql.exe is a great tool that helps developers to create database schema in no time. Normally developers need some data in the database to start the development. You can add users and roles to the Membership database by using any of the two methods.&lt;/p&gt;  &lt;p&gt;1. ASP.Net Website Administration Tool&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;You can launch web administration tool from the Visual Studio project, under the project menu. &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_545DBFD3.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image018_545DBFD3.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_215E099F.png" style="border: 0px none; display: inline;" title="clip_image018" alt="clip_image018" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image018_thumb_215E099F.png" width="211" border="0" height="244"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This tool will connect to the database defined in the machine.config with connection string name “LocalSQLServer”. If you want ASP.Net configuration tool to connect your custom database, add a connection string to your web.config with name “LocalSQLServer” that points to your database. Make sure you use &amp;lt;clear/&amp;gt; or &amp;lt;remove&amp;gt; element to clear the definition for LocalSQLServer inheriting from machine.config. See snapshot of connectionstring that will work with ASP.Net configuration.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_3F5C1793.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image020_3F5C1793.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_68A339C4.jpg" style="border: 0px none; display: inline;" title="clip_image020" alt="clip_image020" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image020_thumb_68A339C4.jpg" width="555" border="0" height="66"&gt;&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;2. Using SQL queries&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;You can execute queries directly against the SQL server database to create users and roles. See the queries that can be used. &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;--*****Query to create user in membership *****--&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;&lt;i&gt;declare @now datetime         &lt;br&gt;set @now= GETDATE()          &lt;br&gt;exec aspnet_Membership_CreateUser 'FormAuthApplication','admin1','pass@word1', '','admin1@contoso.com','','',1,@now,@now,0,0,null&lt;/i&gt;&lt;/b&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;--This will create username admin1 with password pass@word1 and an application named “FormAuthApplication”. You can create any number of applications and each applications can have its own users in the database. You need to mention the same application name in all the related queries. &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;--*****Query to create role in membership db *****--     &lt;br&gt;--Create Role      &lt;br&gt;&lt;b&gt;&lt;i&gt;EXEC aspnet_Roles_CreateRole ' FormAuthApplication', 'Admin'&lt;/i&gt;&lt;/b&gt;      &lt;br&gt;--this will create a role with Admin in the database&lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;--*****Query to add user to role in membership db *****--      &lt;br&gt;&lt;b&gt;&lt;i&gt;EXEC aspnet_UsersInRoles_AddUsersToRoles ' FormAuthApplication', 'admin1', 'Admin', 8&lt;/i&gt;&lt;/b&gt;      &lt;br&gt;--this will add the user admin1 to the role Admin&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Creating membership based applications is easy and you can use Membership along with form authentication to create user authenticated applications. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7831290" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="ASP.Net" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net/default.aspx" /><category term="ASP.Net 4" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net+4/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/sreejukg/archive/tags/.NET/default.aspx" /></entry><entry><title>Create a Web Application in SharePoint 2010 using Claims Based authentication</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/06/15/create-a-web-application-in-sharepoint-2010-using-claims-based-authentication.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/06/15/create-a-web-application-in-sharepoint-2010-using-claims-based-authentication.aspx</id><published>2011-06-15T06:09:00Z</published><updated>2011-06-15T06:09:00Z</updated><content type="html">&lt;p&gt;SharePoint 2010 supports two types of authentication modes. Classic Mode and Claims based. Classic mode supports only windows authentication, where in case of Claims based authentication you can use any of the supported authentication methods such as windows authentication, forms based authentication (LDAP, SQL Server, custom) and SAML token based authentication. &lt;/p&gt;  &lt;p&gt;Read this MSDN article, for understanding more about SharePoint authentication modes &lt;a href="http://technet.microsoft.com/en-us/library/cc262350.aspx" mce_href="http://technet.microsoft.com/en-us/library/cc262350.aspx"&gt;http://technet.microsoft.com/en-us/library/cc262350.aspx&lt;/a&gt; .&lt;/p&gt;  &lt;p&gt;When you create a web application you have the option to select the required authentication mode. If you choose classic mode initially, in future you can switch to Claims-based. If you choose Claims-based, you cannot switch it to classic mode. In this article, I am going to mention the steps required to create a web application in SharePoint 2010 using Claims-based authentication that supports both windows authentication and form authentication. &lt;/p&gt;  &lt;p&gt;From the SharePoint Server, browse the Central Administration website, under Application Management, click on Manage web applications. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_2E0BDEF7.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_2E0BDEF7.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_121AA9FF.jpg" style="border: 0px none; display: inline;" title="clip_image002" alt="clip_image002" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_121AA9FF.jpg" width="244" border="0" height="72"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In the web application management page, click on the new icon to create a new web application&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_450A3A66.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_450A3A66.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_02B72223.png" style="border: 0px none; display: inline;" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_02B72223.png" width="244" border="0" height="180"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The new web application dialog will appear. Make sure you are selecting authentication mode as Claims based. Select a port and give a name for your web application. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_7FC1BD6F.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image004_7FC1BD6F.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_2EC3F947.png" style="border: 0px none; display: inline;" title="clip_image004" alt="clip_image004" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image004_thumb_2EC3F947.png" width="244" border="0" height="189"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Modify the values for “Allow Anonymous” and “use secure socket layer” settings as you required. Leave it as default if you don’t have any specific requirements. For public facing websites, you need to set Allow Anonymous to true. &lt;/p&gt;  &lt;p&gt;In the Claims Authentication Type, make sure enable windows authentication is selected. Click on enable form authentication check box, and provide a membership provider and role manager. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_294562D6.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image005_294562D6.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_73EC2AA3.png" style="border: 0px none; display: inline;" title="clip_image005" alt="clip_image005" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image005_thumb_73EC2AA3.png" width="244" border="0" height="189"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Scroll down till the end of the dialog and click OK. If you want you can change the settings such as application pool name, database name etc. This is not necessary, but maintaining conventions while deciding names will help you in long run.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_50DBB933.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image006_50DBB933.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_465AE513.png" style="border: 0px none; display: inline;" title="clip_image006" alt="clip_image006" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image006_thumb_465AE513.png" width="244" border="0" height="190"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Click ok to create the web application. Now an IIS website will be created by SharePoint. Once successfully created, you will see the below message. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_02C333F1.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image007_02C333F1.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_380C4656.png" style="border: 0px none; display: inline;" title="clip_image007" alt="clip_image007" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image007_thumb_380C4656.png" width="244" border="0" height="158"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In order you to browse your web application created, you need to create a site collection under it. Click on the Create Site Collection link to create the site collection. In the create site collection dialog, enter a title, and select a template for the site. (Make sure you select the correct template as you required.)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_6D5558BB.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image008_6D5558BB.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_4A44E74B.png" style="border: 0px none; display: inline;" title="clip_image008" alt="clip_image008" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image008_thumb_4A44E74B.png" width="244" border="0" height="180"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Scroll down and click ok to create the site collection. Upon completion, you will see the below message. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_0236B562.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image009_0236B562.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_0926421A.png" style="border: 0px none; display: inline;" title="clip_image009" alt="clip_image009" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image009_thumb_0926421A.png" width="244" border="0" height="94"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Click on the web application link or type the web application url in the browser address bar. If you didn’t enable anonymous access while creating web application, you will see the login page that allow you to select both windows authentication/ form authentication (If you enabled anonymous access, use the following url to authenticate, &lt;a href="http://servername:port/_layouts/authenticate.aspx" mce_href="http://servername:port/_layouts/authenticate.aspx"&gt;http://servername:port/_layouts/authenticate.aspx&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;You will see the below login page that allows you to use any of the authentication types either windows/ forms based authentication. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_3BA99F8C.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image011_3BA99F8C.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_2AE1F4DE.jpg" style="border: 0px none; display: inline;" title="clip_image011" alt="clip_image011" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image011_thumb_2AE1F4DE.jpg" width="244" border="0" height="172"&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7830095" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/sreejukg/archive/tags/.NET/default.aspx" /><category term="Forms Authentication" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Forms+Authentication/default.aspx" /></entry><entry><title>Auto-Implemented properties in C#</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/05/31/auto-implemented-properties-in-c.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/05/31/auto-implemented-properties-in-c.aspx</id><published>2011-05-31T18:01:00Z</published><updated>2011-05-31T18:01:00Z</updated><content type="html">&lt;p&gt;When you write applications based on Object Oriented Programming concepts, you need to define lot of classes. When you define classes in C#, you need to define member variables and properties. Usually you define member variables as private and you will expose these member variables with corresponding public properties. This gives you an overhead as you are forced to define private variables just to expose them as properties. &lt;/p&gt;  &lt;p&gt;Consider the below example. This defines a class Member with three fields, username, password and email. The below is a typical implementation of such a class.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public class Member     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string _userName;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string username      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _userName;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _userName = value;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string _password;     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string password      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _password;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _password = value;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string _email;     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string email      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _email;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _email = value;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // …………………remaining implementation including properties and methods..     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you examine the code you will understand, the above code has used the private member variables with names starting with underscore(_) and each member variable has corresponding public properties. In real life situations, the classes will have lot of properties and you need to write lot of code to achieve this. &lt;/p&gt;  &lt;p&gt;With C# 3.0, this has been solved with the support of auto-implemented properties. The auto-implemented properties make your code small and easy to write. With auto-implemented properties, you can avoid such member variables you created for properties. From C# 3.0, the above class can be written as below. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;nbsp; public class Member     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string username     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string password     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string email      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set;      &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;    &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // …………………remaining implementation including properties and methods..     &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;When you define auto implemented property in your class, the C# compiler creates a private, anonymous backing field that can be only accessed through corresponding get and set accessors. You can continue accessing the properties as usual and you save lot of coding time with this. The conventional type of property declaration is still supported and if your application logic require that, you are free to use that method.&lt;/p&gt;&lt;p&gt;reference: &lt;a href="http://msdn.microsoft.com/en-us/library/bb384054.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb384054.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb384054.aspx&amp;nbsp; &lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7810575" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="ASP.Net" scheme="http://weblogs.asp.net/sreejukg/archive/tags/ASP.Net/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Visual+Studio/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/sreejukg/archive/tags/C_2300_/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/sreejukg/archive/tags/.NET/default.aspx" /></entry><entry><title>Backup and Restore in SharePoint 2010 using PowerShell</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/05/18/backup-and-restore-in-sharepoint-2010-using-powershell.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/05/18/backup-and-restore-in-sharepoint-2010-using-powershell.aspx</id><published>2011-05-18T09:44:00Z</published><updated>2011-05-18T09:44:00Z</updated><content type="html">&lt;p&gt;It is essential to have proper backup/restore strategy in place for your SharePoint farms. SharePoint 2010 provides three types of tools for backup/restore for your server farm. The tools are&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Central Administration&lt;/p&gt;    &lt;p&gt;Windows PowerShell&lt;/p&gt;    &lt;p&gt;Stsadm.exe&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You need to carefully decide what you are going to backing up and where you are storing these backups. Be noted that SharePoint 2010 doesn’t provide a method to backup directly to tape. SharePoint 2010 backs up to a UNC file share. Technically UNC file share can be anywhere, but it is recommended that you take your backup to a UNC file share in your LAN.&lt;/p&gt;  &lt;p&gt;Let me explore each tool available for backup.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Central Administration:&lt;/b&gt; You cannot schedule a backup via Central Administration. The primary use of Central Administration backups is to verify the configuration of the target backup location and to back up server farms before major operations. It is recommended to take backup using Central Administration, once you create all web applications and site collections required by your server farm. Also take one backup using Central Administration before any major upgrade of the farm. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Windows PowerShell:&lt;/b&gt; The preferred way to take backups in SharePoint Server 2010 is by using windows PowerShell. This method gives you the most options and will be fully supported in the future. You can also schedule the backup using Windows PowerShell.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Stsadm.exe:&lt;/b&gt; Stsadm was the command line administration tool available for SharePoint 2007. SharePoint 2010 also provides Stsadm, but it is recommended to use PowerShell as Stsadm is there to offer backward compatibility. Many of the Stsadm commands implemented in SharePoint Server 2010 existed in SharePoint Server 2007. Configuring command-line backups using Stsadm is easy, but it is limited to basic farm backup functionality&lt;/p&gt;  &lt;p&gt;In this article I am going to demonstrate the PowerShell commandlets to take various types of backup from SharePoint 2010. &lt;/p&gt;  &lt;p&gt;First you need to decide, where you are going to store the backups. Make a UNC share for that location. In order to back up to file share, the following accounts need full permissions to the backup location.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;SQL Server service account &lt;/li&gt;    &lt;li&gt;SharePoint 2010 Timer Log On account &lt;/li&gt;    &lt;li&gt;User account, who is executing the command. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Also you have to ensure that you have enough disk space available for the backup. In the remaining section of this article details the various backup options available to you.&lt;/p&gt;  &lt;h3&gt;Farm Backup&lt;/h3&gt;  &lt;p&gt;To back up a server farm using Windows PowerShell, you can use Backup-SPFarm command. The syntax of the command is as follows. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Backup-SPFarm -directory &amp;lt;UNC File Share&amp;gt; -BackupMethod &amp;lt;Full | Differential&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The Backup-SPFarm supports the following options&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Directory&lt;a class="" title="location_previously" name="location_previously"&gt;&lt;/a&gt; - Defines the backup location previously prepared. &lt;/li&gt;    &lt;li&gt;BackupThreads&lt;a class="" title="using_command" name="using_command"&gt;&lt;/a&gt; - The default thread count is 3. Increasing the thread count will result in faster backup, but it will affect the server performance during backup. Also increasing the threads will make it difficult to check backup logs. &lt;/li&gt;    &lt;li&gt;ShowTree&lt;a class="" title="that_are" name="that_are"&gt;&lt;/a&gt; - Displays the objects in the farm those are available to be backed up. If you use this setting in conjunction with Item&lt;a class="" title="scoped_to" name="scoped_to"&gt;&lt;/a&gt;, it is scoped to the object underneath Item. &lt;/li&gt;    &lt;li&gt;ConfigurationOnly&lt;a class="" title="This_will" name="This_will"&gt;&lt;/a&gt; – This option specifies to backup only the farm configuration data. No content will be backed up when you specify ConfigurationOnly in the command. &lt;/li&gt;    &lt;li&gt;Item – You can back up a farm component—such as a Web application, content database, or service application—using the Item&lt;a class="" title="up_site" name="up_site"&gt;&lt;/a&gt; parameter. You cannot back up site collections, sites, list, libraries, or list items using the Item parameter. &lt;/li&gt;    &lt;li&gt;Percentage&lt;a class="" title="on_the" name="on_the"&gt;&lt;/a&gt; - You can specify the progress increments on the screen. If scripting, you do not need to use the Percentage option. &lt;/li&gt;    &lt;li&gt;Force - Using force&lt;a class="" title="if_the" name="if_the"&gt;&lt;/a&gt; will bypass the default behavior of halting the backup if the estimator calculates there is insufficient disk space. &lt;/li&gt;    &lt;li&gt;Verbose&lt;a class="" title="the" name="the"&gt;&lt;/a&gt; – This option will display the progress of the backup in the command line. If this is not presented, you won’t be presented with current progress information. &lt;/li&gt;    &lt;li&gt;WhatIf&lt;a class="" title="output_of" name="output_of"&gt;&lt;/a&gt; - This is a common PowerShell feature, if you specify this option, the command will display the output of running the backup without actually performing the backup. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Restore a Server Farm&lt;/h3&gt;  &lt;p&gt;The backups taken by PowerShell can be restored by Central Administration. Also it is possible to restore the farm using the PowerShell Script. To restore a farm from backup you can use Restore-SPFarm commandlet. &lt;/p&gt;  &lt;p&gt;The UNC share where you configured your backup, may contains more than one backup. So the PowerShell command for restore requires you to specify the backup ID for the backup to restore. No problem, there is a command available to list all the backups available under a UNC share. The command is as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Get-SPBackupHistory -Directory &amp;lt;Backup folder&amp;gt; -ShowBackup [-Verbose]&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;See the output of the command. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_7C7BC4BE.jpg" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image002_7C7BC4BE.jpg"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_0B827DCC.jpg" style="border-width: 0px; display: inline;" title="clip_image002" alt="clip_image002" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image002_thumb_0B827DCC.jpg" width="244" border="0" height="47"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There is another way to find the backup ID, in the root folder of the UNC share used for backup; you can find an xml file named spbrtoc.xml (SharePoint Backup Restore Table Of Contents). To find the ID, open the UNC share in windows explorer, open the spbrtoc.xml in any text editor (e.g. notepad) and you can find all backups with IDs]&lt;/p&gt;  &lt;p&gt;The syntax for Restore-SPFarm command is as follows&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Restore-SPFarm -Directory UNCShare -BackupId &amp;lt;id of backup&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The Restore-SPFarm supports the following options.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Directory - specifies the path to the SharePoint Server 2010 backup location you want to restore from. There must be a valid spbrtoc.xml file in the root of the backup directory. &lt;/li&gt;    &lt;li&gt;RestoreMethod&lt;a class="" title="the_selected" name="the_selected"&gt;&lt;/a&gt; – Either New or Overwrite. The New option restores the selected backup components and configuration using either new database names or a new SQL Server instance, or both. The Overwrite option restores the content and configuration to the same database instances. &lt;/li&gt;    &lt;li&gt;BackupId&lt;a class="" title="ID_you" name="ID_you"&gt;&lt;/a&gt; - The unique backup ID you want to restore. &lt;/li&gt;    &lt;li&gt;ConfigurationOnly&lt;a class="" title="configuration_data" name="configuration_data"&gt;&lt;/a&gt; - Restores only the farm configuration data, it will not restore any content. &lt;/li&gt;    &lt;li&gt;Confirm&lt;a class="" title="by_typing" name="by_typing"&gt;&lt;/a&gt; - Requires you to confirm the backup by typing Y, it is just a precautionary option. &lt;/li&gt;    &lt;li&gt;FarmCredentials&lt;a class="" title="supply_the" name="supply_the"&gt;&lt;/a&gt; - You must supply the farm credentials when restoring content and configuration data. &lt;/li&gt;    &lt;li&gt;Force&lt;a class="" title="the_case" name="the_case"&gt;&lt;/a&gt; – if you want to restore to the existing farm, use this option. &lt;/li&gt;    &lt;li&gt;Item - Indicates the part of the backup you want to restore. For example, if you have performed a full farm backup, you might choose to only restore a Web application or content database. &lt;/li&gt;    &lt;li&gt;NewDatabaseServer - If you want to restore to an alternate database server, you can specify that during the restore process. &lt;/li&gt;    &lt;li&gt;Percentage&lt;a class="" title="is_seen" name="is_seen"&gt;&lt;/a&gt; - You can specify the progress increments on the screen. Percentage complete is seen only when using the Verbose option. &lt;/li&gt;    &lt;li&gt;RestoreThreads&lt;a class="" title="of_process" name="of_process"&gt;&lt;/a&gt; - The default number of process threads is 3. This can be increased to 10 or decreased to 1. &lt;/li&gt;    &lt;li&gt;WhatIf&lt;a class="" title="a_command" name="a_command"&gt;&lt;/a&gt; - Displays the effect of a command without running an actual restore process. &lt;/li&gt;    &lt;li&gt;Verbose - Displays the output of a command. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Backup web applications using PowerShell&lt;/h3&gt;  &lt;p&gt;You can use the –item option to the Backup-SPFarm command to back up a particular component in a farm. By specifying the item option with the Backup-SPFarm command, you can backup a web application, a service application or a content database. Also using the Restore-SPFarm command, you can restore any of these. &lt;/p&gt;  &lt;p&gt;You can also restore individual items from a full back up without restoring the entire farm backup. So if you are taking full farm backup, it is not necessary to take item wise backups separately. &lt;/p&gt;  &lt;p&gt;In order to backup an item, you need to specify the item name you need to backup. To retrieve the item names for backing up, you can use the following command.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Backup-SPFarm –showtree&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This command will list the hierarchical items available in the farm. You can retrieve the item name by following the command output. &lt;/p&gt;  &lt;p&gt;See the output of the command&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_0FAC5591.png" mce_href="http://weblogs.asp.net/blogs/sreejukg/clip_image003_0FAC5591.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_64A441BE.png" style="border-width: 0px; display: inline;" title="clip_image003" alt="clip_image003" mce_src="http://weblogs.asp.net/blogs/sreejukg/clip_image003_thumb_64A441BE.png" width="244" border="0" height="184"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;To backup a particular item, you can &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Backup-spfarm –directory &amp;lt;uncpath&amp;gt; -item “Hierarchical item name” –backupmethod FULL |Differential&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;e.g.: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Backup-spfarm –directory \\ServerName\UNCShare -item “Farm\ Microsoft SharePoint Foundation Web Application\SharePoint - 2038” –backupmethod FULL&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Similarly you can Restore a particular item from a farm backup. See the sample command&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Restore-SPFarm –directory &amp;lt;uncpath&amp;gt; -backupid &amp;lt;backup id&amp;gt; -item &amp;lt;item to be backed up&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Backup Site Collection&lt;/h3&gt;  &lt;p&gt;Sharepoint 2010 supports granular backup and restore. You can backup/restore site collections, individual sites and lists. In this section I am going to cover only the site collection backup. &lt;/p&gt;  &lt;p&gt;Windows PowerShell will automatically lock the site collection during backup to reduce the risk of SQL blocking and locking errors. Also it is possible to backup site collection using a SQL snapshot to back up the data. To backup site collections you can use the command Backup-SPSite. The following are the options available for Backup-SPSite. &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Identity&lt;a class="" title="or_GUID" name="or_GUID"&gt;&lt;/a&gt; - specifies the URL or GUID of the site collection to back up &lt;/li&gt;    &lt;li&gt;Path&lt;a class="" title="the_file" name="the_file"&gt;&lt;/a&gt; -The full backup path, including the file name.&amp;nbsp; Here you can use the file path, it is not necessary to specify the UNC path here.&amp;nbsp; &lt;/li&gt;    &lt;li&gt;Confirm - Requires you to confirm the backup by typing Y. &lt;/li&gt;    &lt;li&gt;Force&lt;a class="" title="want_to" name="want_to"&gt;&lt;/a&gt; - If you want to overwrite an existing back up file, use the Force option. &lt;/li&gt;    &lt;li&gt;NoSiteLock - If you want to back up the site collection without making it read-only, use the NoSiteLock&lt;a class="" title="Be_aware" name="Be_aware"&gt;&lt;/a&gt; option. If you are taking large site collection backups, without a site lock, the back up may fail. &lt;/li&gt;    &lt;li&gt;UseSqlSnapshot - If you need to back up site collections during the day and require users to continue full read/write operations, you’ll need to create a SQL snapshot to back up from. Using this option creates a temporary SQL Server database snapshot. After the snapshot is created, the backup will be from the snapshot, not the live database. This is the best method to get a full fidelity site collection backup. &lt;/li&gt;    &lt;li&gt;WhatIf&lt;a class="" title="without_performing" name="without_performing"&gt;&lt;/a&gt; Shows the effects of a command without performing the actual backup &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;E.G.: Backup-spsite –identity http://win-hgdsnnuakhv/sites/testsite -path c:\sitebkup\mysite.bak&lt;/p&gt;  &lt;h3&gt;Schedule backups&lt;/h3&gt;  &lt;p&gt;Once the server farm is up and running, you need to take regular backups. You need to automate the server backup procedure. You need to decide your backup plan. This depends on your farm. You need to carefully decide the backup plan. Also test your back up by restoring it to a test environment, for making sure you are ready for disaster recovery.&lt;/p&gt;  &lt;p&gt;Providing a recommendation for backup farm is depends on the implementation. Recently I worked with a farm, where I have 3 site collections in 3 different web applications. I have decided the following backup sets. &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Monthly full backup for the entire server farm &lt;/li&gt;    &lt;li&gt;Weekly differential backup for the entire server farm &lt;/li&gt;    &lt;li&gt;Weekly full backup for each site collection &lt;/li&gt;    &lt;li&gt;Daily differential backup for each site collection &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Make sure you are taking the decision by carefully considering your back up plans.&lt;/p&gt;  &lt;p&gt;Next you need to schedule the scripts. You need to do the following tasks for scheduling the back up.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create a .ps1 file with your PowerShell commands &lt;/li&gt;    &lt;li&gt;Create a batch file that calls the ps1 file &lt;/li&gt;    &lt;li&gt;Configure the batch file to execute in certain interval. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The following steps demonstrate scheduling a full farm backup using PowerShell. First create a Windows PowerShell script file with the following contents.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Add-PSSnapin Microsoft.SharePoint.PowerShell      &lt;br&gt;Backup-SPFarm -directory \\win-hgdsnnuakhv\farmbkup -backupmethod FULL&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Save this file with extension .ps1. I have named the file as farmfullbkup.ps1.&lt;/p&gt;  &lt;p&gt;Now create a batch file, which calls this PowerShell Script. The batch file content is as follows.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;PowerShell -command C:\BackupScheduleScripts\FarmFullBkup.ps1&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Save this file with extension .bat. In my case, I named the file as FarmFullBkup.bat&lt;/p&gt;  &lt;p&gt;Now you can schedule this batch file as you required using Windows task scheduler. In my case I configured this to execute once in a month. &lt;/p&gt;  &lt;h3&gt;Conclusion&lt;/h3&gt;  &lt;p&gt;SharePoint provides lot of options for backup/ restore, from a full farm level to list level. Planning for backup / restore in very important in any server farm and you need to carefully decide what backup / restore strategy will help you. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7795203" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="Sharepoint" scheme="http://weblogs.asp.net/sreejukg/archive/tags/Sharepoint/default.aspx" /><category term="SharePoint 2010" scheme="http://weblogs.asp.net/sreejukg/archive/tags/SharePoint+2010/default.aspx" /></entry><entry><title>What is new in HTML 5</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/sreejukg/archive/2011/05/07/what-is-new-in-html-5.aspx" /><id>http://weblogs.asp.net/sreejukg/archive/2011/05/07/what-is-new-in-html-5.aspx</id><published>2011-05-07T11:06:00Z</published><updated>2011-05-07T11:06:00Z</updated><content type="html">&lt;p&gt;Now most of the browsers have the support for HTML 5. From now, web developer’s needs to think how they can utilize the new elements arrived with HTML 5 in their web applications. In this article I am listing some major elements that every web developer will be interested in. &lt;/p&gt;  &lt;h3&gt;Canvas&lt;/h3&gt;  &lt;p&gt;This is one of the most interested features introduced. Canvas element allows you to build 2d graphics rendered to the html page. The contents can be drawn to the canvas using java script, thus provides inbuilt capabilities of animations without the help of any third party component. &lt;/p&gt;  &lt;p&gt;If you want to read more about Canvas element, follow the below links&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Canvas_element" mce_href="http://en.wikipedia.org/wiki/Canvas_element"&gt;http://en.wikipedia.org/wiki/Canvas_element&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.w3.org/TR/html5/the-canvas-element.html" mce_href="http://www.w3.org/TR/html5/the-canvas-element.html"&gt;http://www.w3.org/TR/html5/the-canvas-element.html&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://weblogs.asp.net/sreejukg/archive/2010/10/11/introduction-to-canvas-element-in-html-5.aspx" mce_href="http://weblogs.asp.net/sreejukg/archive/2010/10/11/introduction-to-canvas-element-in-html-5.aspx"&gt;http://weblogs.asp.net/sreejukg/archive/2010/10/11/introduction-to-canvas-element-in-html-5.aspx&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html" mce_href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html"&gt;http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Audio &lt;/h3&gt;  &lt;p&gt;Prior to HTML 5, if you want to play audio in the browser, you are supposed to use Microsoft Silverlight, Adobe Flash, or other browser plugins. The ability to play the audio by the browser varies depending on the plugins available in the browser. HTML 5 introduces a new element named audio that brings in-built support for the audio by browsers. With audio element, browsers have native support for audio playback. &lt;/p&gt;  &lt;p&gt;To include audio in the HTML document, use the following syntax.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;audio src=”audio file path” &amp;gt;&amp;lt;/audio&amp;gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To read more about audio element, follow the below links&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://dev.w3.org/html5/markup/audio.html" mce_href="http://dev.w3.org/html5/markup/audio.html"&gt;http://dev.w3.org/html5/markup/audio.html&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.w3schools.com/html5/tag_audio.asp" mce_href="http://www.w3schools.com/html5/tag_audio.asp"&gt;http://www.w3schools.com/html5/tag_audio.asp&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://html5doctor.com/native-audio-in-the-browser/" mce_href="http://html5doctor.com/native-audio-in-the-browser/"&gt;http://html5doctor.com/native-audio-in-the-browser/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Video &lt;/h3&gt;  &lt;p&gt;Similar to audio, prior versions of HTML 5 required 3&lt;sup&gt;rd&lt;/sup&gt; party plugins to play the video in browser. HTML 5 introduces the new element video element that brings native support for browsers to playback video files in the browser. &lt;/p&gt;  &lt;p&gt;To include video in the document, you can use the following syntax. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;video src=”path to the video file”&amp;gt;&amp;lt;/video&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The video tag have support for attributes such as auto play, preload, width, height etc. Also the video element can be accessed using script, by using client side script, you can play/pause the video. To read more about video element follow the below urls.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.w3.org/TR/html5/video.html#video" mce_href="http://www.w3.org/TR/html5/video.html#video"&gt;http://www.w3.org/TR/html5/video.html#video&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.w3schools.com/html5/html5_video.asp" mce_href="http://www.w3schools.com/html5/html5_video.asp"&gt;http://www.w3schools.com/html5/html5_video.asp&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://html5doctor.com/the-video-element/" mce_href="http://html5doctor.com/the-video-element/"&gt;http://html5doctor.com/the-video-element/&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;In addition to the above, HTML 5 adds lot of new elements. Some elements with their usage are given below.&lt;/p&gt;  &lt;blockquote&gt;   &lt;h4&gt;Header – Specify heading information for a page. &lt;/h4&gt;    &lt;h4&gt;Nav – defines a section that meant for navigation&lt;/h4&gt;    &lt;h4&gt;Figure – defines a group of media element and their caption&lt;/h4&gt;    &lt;h4&gt;Footer – defines the footer of the page&lt;/h4&gt;    &lt;h4&gt;Section – defines a section in the document. &lt;/h4&gt;    &lt;h4&gt;and lot more….&lt;/h4&gt; &lt;/blockquote&gt;  &lt;p&gt;If you want to see a complete reference of all tags available in HTML 5, visit the below link.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://www.w3schools.com/html5/html5_reference.asp" mce_href="http://www.w3schools.com/html5/html5_reference.asp"&gt;http://www.w3schools.com/html5/html5_reference.asp&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;h3&gt;Recommended reading&lt;/h3&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://dev.w3.org/html5/spec/Overview.html" mce_href="http://dev.w3.org/html5/spec/Overview.html"&gt;http://dev.w3.org/html5/spec/Overview.html&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;a href="http://www.w3schools.com/html5/html5_reference.asp" mce_href="http://www.w3schools.com/html5/html5_reference.asp"&gt;http://www.w3schools.com/html5/html5_reference.asp&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Note: If you find other links are useful for the users to understand more about HTML 5, please post it in the comments or send it to me as email, so that I can include this in the list. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7779832" width="1" height="1"&gt;</content><author><name>sreejukg</name><uri>http://weblogs.asp.net/members/sreejukg.aspx</uri></author><category term="General Software Development" scheme="http://weblogs.asp.net/sreejukg/archive/tags/General+Software+Development/default.aspx" /><category term="HTML 5" scheme="http://weblogs.asp.net/sreejukg/archive/tags/HTML+5/default.aspx" /></entry></feed>
