<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DkQCSH89eSp7ImA9WhRUEkg.&quot;"><id>tag:blogger.com,1999:blog-12212983</id><updated>2012-01-22T23:16:09.161+05:30</updated><category term="Visual Studio" /><category term="Publishing.PublishingPage.GetPublishingPage" /><category term="List Items" /><category term="amit kumar" /><category term="Difference between SpListItem.SystemUpdate() and SpListItem.Update()" /><category term="Spreadsheet" /><category term="TimeSpan" /><category term="nature" /><category term="Create folder in list document library" /><category term="Rajpal Yadav" /><category term="SPList objects" /><category term="Integrity" /><category term="UserProfileManager" /><category term="karolbagh" /><category term="UserProfileChangeQuery.ChangeTokenStart" /><category term="cup" /><category term="relative url in master page in sharepoint" /><category term="SharePoint Rich Text Box(InputFormTextBox)" /><category term="Encrypting Web.Config" /><category term="Using C#" /><category term="Export Import SharePoint List" /><category term="Search Text in excel sheet" /><category term="MicroSoft.SharePoint" /><category term="PublishingWeb" /><category term="MOSS" /><category term="User Control" /><category term="Dot Net" /><category term="next" /><category term="engaged" /><category term="Difference between an Relative and absolute URLs/Path" /><category term="System.Web.UI" /><category term="Microsoft.SharePoint.Publishing.WebControls.SPUrlExpressionBuilder" /><category term="Regal Building" /><category term="SharePoint Document Library" /><category term="Windows Authenticatin" /><category term="CSS" /><category term="System.Data" /><category term="CreatedBy" /><category term="make good relationshiop" /><category term="previous 10 pages" /><category term="delete column in excel sheet" /><category term="Style Sheet" /><category term="within a SharePoint" /><category term="VBA" /><category term="People" /><category term="Life" /><category term="Creating and deploying SharePoint Feature" /><category term=".Net Workflow" /><category term="MOSS2007" /><category term="Microsoft Visual Studio 2005" /><category term="ASP.Net" /><category term="declared" /><category term="Sharepoint C# example" /><category term="SharePoint.Publishing" /><category term="Visual C# 2008" /><category term="what is caching" /><category term="User Properties" /><category term="webpart" /><category term="Microsoft" /><category term="Feature For Sharepoint" /><category term=".Net" /><category term="paging" /><category term="passed" /><category term="Common Language Runtime" /><category term="clientid" /><category term="site" /><category term="ASP .Net Page Life Cycle" /><category term="AllowUnsafeUpdates" /><category term="Form Authentication" /><category term="datetime now" /><category term="Role Definitions" /><category term="Leadership" /><category term="Exception" /><category term="Effectively" /><category term="caches" /><category term="UserProfileChangeCollection" /><category term="Microsoft Community Contributor Award 2011" /><category term="Authentication Mode in ASP.Net" /><category term="DPAPI" /><category term="Inheritance" /><category term="rainy day" /><category term="What is feature in SharePoint" /><category term="different between .ToString() and Convert.ToString()" /><category term="Pages" /><category term="ASP.Net Page" /><category term="SharePoint" /><category term="body" /><category term="Get distinct value" /><category term="wife" /><category term="/E" /><category term="Exception Handling" /><category term="Global Navigation Menu Item" /><category term="lesbians" /><category term="Microsoft.SharePoint.Publishing;Accessing SharePoint Data" /><category term="Export/Import excel file" /><category term="make girl/boy happy" /><category term="List.Items.Add" /><category term="ServerContext" /><category term="Windows Data Protection API" /><category term="illegal" /><category term="tea" /><category term="RSA provider" /><category term="WPF" /><category term="SPLimitedWebPartManager" /><category term="SharePoint(MOSS) List Web Service" /><category term="Gaffar Market" /><category term="Publishing and Synchronizing Excel 2007" /><category term="SPListItem.ModerationInformation.Status" /><category term="Display column" /><category term="Publishing Pages" /><category term="SPFieldType" /><category term="Delete" /><category term="ServerContext.GetContext" /><category term="PropertyCollection" /><category term="Barakhamba Road" /><category term="mumbai blast" /><category term="UserProfile" /><category term="pointers" /><category term="Overview" /><category term="System.Web.Mail" /><category term="encryption" /><category term="copy folder and sub directory" /><category term="SpListItem.Update()" /><category term="family" /><category term="List" /><category term="Error" /><category term="Add Technorati Tags to a Blog" /><category term="Example of Link Tag" /><category term="SharePoint 2007" /><category term="UserProfile webservice" /><category term="SPNavigation.QuickLaunch" /><category term="Microsoft.Practices.EnterpriseLibrary" /><category term="Authentication in ASP.Net" /><category term="Add code tag to [code] [/code] block" /><category term="blogger beta" /><category term="onload" /><category term="Jimmy Shergill" /><category term="SPWeb" /><category term="parameters" /><category term="Microsoft SharePoint (MOSS 2007)" /><category term="ow to Join Technorati" /><category term="SharePoint 2010" /><category term="Web.Site.SystemAccount" /><category term="Batch file" /><category term="decisions" /><category term="Gay rights" /><category term="SPSecurity.RunWithElevatedPrivileges" /><category term="WSS 3.0/MOSS 2007" /><category term="document.all" /><category term="Header.xsl" /><category term="Queer Pride" /><category term="sharepoint moss 2007" /><category term="husband" /><category term="Windows SharePoint Services 3.0" /><category term="Bhajias" /><category term="delegate" /><category term="Mujahideen" /><category term="Update List Item" /><category term="previous" /><category term="web part properties" /><category term="Pakoras" /><category term="HREF tag" /><category term="signature" /><category term="How to Customize     Styles" /><category term="Response.Redirect" /><category term="romantic day" /><category term="custom validation" /><category term="GetUserProfile" /><category term="assembly" /><category term="How access SharePoint Data" /><category term="default role" /><category term="mcapassion" /><category term="Client Side Script" /><category term="Content Deployment Wizard" /><category term="SPList.Upate()" /><category term="$SPUrl:~Site" /><category term="set focus" /><category term="Rainbow Pride Week" /><category term="RegisterStartupScript" /><category term="Extranet Password Reset" /><category term="troubleshoot" /><category term="search result" /><category term="move vertical scrollbar" /><category term="Encrypting" /><category term="SmartPart" /><category term="fragment cache" /><category term="strong relationship" /><category term="Page Document Library" /><category term="Naseeruddin Shah" /><category term="SPContext.Current.Web.CurrentUser.LoginName" /><category term="Personal Life" /><category term="UserProfileChangeQuery" /><category term="Content Import/Export" /><category term="asp.net cache engine" /><category term="ASP.Net Caching" /><category term="Workflow" /><category term="syntax highlighting" /><category term="Search" /><category term="API" /><category term="C#" /><category term="public private cryptography" /><category term="call" /><category term="Microsoft.SharePoint.Navigation" /><category term="Summary Link Web Part" /><category term="home life" /><category term="Passport Authentication" /><category term="saturday" /><category term="Update" /><category term="Macros" /><category term="SharePoint Portal Server" /><category term="work life" /><category term="how to make life happy" /><category term="integrated role" /><category term="Content Editor Web Part in SharePoint(MOSS)" /><category term="Using" /><category term="Terrorism" /><category term="web cache" /><category term="C# 2008" /><category term="RSA" /><category term="ASP.Net Grid View Control" /><category term="Content By     Query" /><category term="stock market" /><category term="Global Assembly Cache Tool(Gacutil.exe)" /><category term="consensual homosexual" /><category term="golden words" /><category term="callback methods" /><category term="Command file" /><category term="Dilli" /><category term="RSACryptoServiceProvider" /><category term="ModifiedBy" /><category term="using SharePoint Object Model" /><category term="Greater Kailash" /><category term="Asp.Net FAQ" /><category term="ItemUpdated" /><category term="SPSite" /><category term="Accessing SharePoint Data" /><category term="Add" /><category term="bollywood" /><category term="ItemStyle.xsl" /><category term="user registration" /><category term="Distinct().ToArray()" /><category term="12 hives" /><category term="User Profile" /><category term="output cache" /><category term="custom web part" /><category term="StandardMenu" /><category term="webpartzone" /><category term="amit kashyap" /><category term="SharePoint workflow" /><category term="SharePoint List" /><category term="maid" /><category term="surprise" /><category term="Custom role" /><category term="love" /><category term="SharePoint (MOSS)" /><category term="Customizing web part in SharePoint" /><category term="next 10 pages" /><category term=".Net 2.0" /><category term="A Tag" /><category term="CLR" /><category term="MOSS 2007" /><category term="add desired columns" /><category term="AppSettings" /><category term=".Net Form integration with workflow" /><category term="Column Number" /><category term="NET Framework 3.5" /><category term="good morning" /><category term="Office SharePoint Server" /><category term="delegate's signature" /><category term="Customizing Styles" /><category term="System.Web" /><category term="sleep" /><category term="green" /><category term="Page load" /><category term="Row Number" /><category term="Serial Bomb Blast in Delhi" /><category term="Windows Presentation Foundation (WPF)" /><category term="Deploy feature sharepoint" /><category term="/T" /><category term="cache memory" /><category term="Connaught Place" /><category term="Excel Macros" /><category term="xcopy" /><category term="membership" /><category term="good listner" /><category term="focus()" /><category term="differences" /><category term="form based authentication in sharepoint" /><category term="GetUserProfileByName" /><category term="chutney" /><category term="Metadata" /><category term="Office.Microsoft.com" /><category term="System.Xml;System.Xml.Xsl;XSLT;Render XML;XsltView;XmlDocument.LoadXml;XslTransform.Load;amit kumar;XSL Transformations" /><category term="XSL Styles Sheets" /><category term="SPListItem.Update" /><category term="asp.net web form" /><category term="VerticalScrollBar" /><category term="fonts colours content editor" /><category term="NULL Exception" /><category term="ASP.Net 2.0 Gridview" /><category term="SpListItem" /><category term="Happiness" /><category term="Search Text" /><category term="deployment of SharePoint" /><category term="SPListItem.SystemUpdate" /><category term="Role Assignments" /><category term="SPItemEventProperties" /><category term="Limit the length of SharePoint Rich Text Box" /><category term="unique array" /><category term="Document Library" /><category term="Custom List" /><category term="golden rule" /><category term="SPListtem.Level" /><category term="Get Unique Array" /><category term="how make partner happy" /><category term="Bomb Blast" /><category term="Terrorist" /><category term="HTML Link Tag" /><category term="customize search results" /><category term="CODING BLOG" /><category term="SPUrl:~SiteCollection" /><category term="SpList" /><category term="Delhi" /><category term="XAML" /><category term="add code block" /><category term="good relationship" /><category term="Add code tag" /><category term="amitkumar_mca04" /><category term="Saddi Dilli" /><category term="WebPartPageUserException" /><category term="search engine optimization" /><category term="code block" /><category term="Page" /><category term="Professional Life" /><category term="web.config" /><category term="Ram Manohar" /><category term="constitution" /><category term="custom paging" /><category term="XSLT" /><category term="defaultprovider" /><category term="site.RootWeb.AllUsers" /><category term="A Wednesday" /><category term="RSA Algorithm" /><category term="copy particualar file" /><category term="add new styles" /><category term="SharePoint Web Service" /><category term="SharePoint Features" /><category term="sonofsmartpart" /><category term="Blogger" /><category term="amit kumar kashyap" /><category term="type safe" /><category term="photo" /><category term="custom" /><category term="SharePoint List C# example" /><category term="Insert column in excel sheet" /><category term="session" /><category term="HTML" /><category term="SharePoint(MOSS)" /><category term="C#.Net" /><category term="photographic" /><category term="JavaScript" /><category term="Anupam Kher" /><category term="partner" /><category term="AccountName" /><category term="Membership Provider" /><category term="Leader" /><category term="Stringcomparison. InvariantCultureIgnoreCase" /><category term="Windows Data Protection" /><category term="data caching" /><category term="ASP.Net 2.0" /><category term="cache" /><category term="anonymous method" /><category term="client-side script" /><category term="C-Sharp" /><category term="Master Page in SharePoint(MOSS)" /><category term="Visual Studio 2005" /><category term="indian cinema" /><category term="XDocument;XmlDocument;System.Xml.Linq;LINQ to XML;write XML;.Load;read XML;amit kumar;.NET Language-Integrated Query for XML Data" /><category term="gays" /><category term="make girl happy" /><category term="YUMMY" /><category term="form" /><category term="Publishing site Navigation" /><category term="Weather" /><category term="Item Styles" /><category term="Services 3.0" /><category term="SharePoint Object Model" /><category term="How send email in .net" /><category term="Palika Bazzar" /><category term="Customizing Search Results with Custom XSLTs in SharePoint" /><category term="SPNavigationNode" /><category term="Publishing.PublishingPage.IsPublishingPage" /><category term="New Delhi" /><category term="SiteCollection" /><category term="Script" /><category term="SpListItem.SystemUpdate()" /><category term="transvestites" /><category term="functionality" /><category term="gay parade" /><category term="SPUrl" /><category term="document" /><category term="objects" /><category term="custom user control" /><category term="Quick Launch menu" /><category term="copy all files into one folder" /><category term="amit" /><category term="Sharepoint 2007 or WSS 3.0 export/import" /><category term="SEO" /><category term="increase blog traffic" /><category term="amitkumarmca04" /><category term="How send email in .net with attachment" /><category term="relative url" /><category term="Deepal Shaw" /><category term="SharePoint 2010 client object model" /><category term="Microsoft.net" /><category term="named method" /><title>aMiT kUmAr</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://amitkumarmca04.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>70</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/amitkuar" /><feedburner:info uri="blogspot/amitkuar" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><logo>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</logo><entry gd:etag="W/&quot;CUQDR3Y9cSp7ImA9WhdbE08.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-5627797422700407242</id><published>2011-10-11T14:26:00.000+05:30</published><updated>2011-10-11T14:26:16.869+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-11T14:26:16.869+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SPSecurity.RunWithElevatedPrivileges" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfileManager" /><category scheme="http://www.blogger.com/atom/ns#" term="ServerContext.GetContext" /><category scheme="http://www.blogger.com/atom/ns#" term="GetUserProfile" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfile" /><category scheme="http://www.blogger.com/atom/ns#" term="SPContext.Current.Web.CurrentUser.LoginName" /><title>Get UserProfile Object of Logged-in User</title><content type="html">In this article, I will explain how to get UserProfile object for Logged-in User (current user).
&lt;/br&gt;
&lt;pre name="code" class="CSharp"&gt;
//Function Call
UserProfile objUserProfile= GetProfileOfCurrentUser(SPContext.Current.Web.CurrentUser.LoginName)
public UserProfile GetProfileOfCurrentUser(string accountName)
        {
            UserProfile profile = null;
            try
            {
                if (string.IsNullOrEmpty(accountName))
                {
                    return null;
                }
                SPSecurity.RunWithElevatedPrivileges(delegate()
                {
                    SPSite site = SPContext.Current.Site;
                    ServerContext context = ServerContext.GetContext(site);

                    UserProfileManager profileManager = new UserProfileManager(context);
                    if (!profileManager.UserExists(accountName))
                    {
                        profile = null;
                    }

                    profile = profileManager.GetUserProfile(accountName);
                });
            }
            catch (Exception ex)
            {
                profile = null;
            }
            return profile;
        }
&lt;/pre&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-5627797422700407242?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/5627797422700407242/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=5627797422700407242" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/5627797422700407242?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/5627797422700407242?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/Zoikn2_kk2c/get-userprofile-object-of-logged-in.html" title="Get UserProfile Object of Logged-in User" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/10/get-userprofile-object-of-logged-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMBR3YzfSp7ImA9WhdbE08.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-3366069355556986322</id><published>2011-10-11T14:10:00.000+05:30</published><updated>2011-10-11T14:10:56.885+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-11T14:10:56.885+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Web.Site.SystemAccount" /><category scheme="http://www.blogger.com/atom/ns#" term="AllowUnsafeUpdates" /><category scheme="http://www.blogger.com/atom/ns#" term="CreatedBy" /><category scheme="http://www.blogger.com/atom/ns#" term="SPItemEventProperties" /><category scheme="http://www.blogger.com/atom/ns#" term="SPSite" /><category scheme="http://www.blogger.com/atom/ns#" term="SPSecurity.RunWithElevatedPrivileges" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="Update List Item" /><category scheme="http://www.blogger.com/atom/ns#" term="SPWeb" /><category scheme="http://www.blogger.com/atom/ns#" term="ItemUpdated" /><category scheme="http://www.blogger.com/atom/ns#" term="site.RootWeb.AllUsers" /><category scheme="http://www.blogger.com/atom/ns#" term="ModifiedBy" /><title>Event receiver to update an item's in list</title><content type="html">&lt;b&gt;How to update Created By and Modified By fields in sharepoint list using C#
&lt;/b&gt;&lt;/br&gt;
In this article I will explain, how to update list item in event receiver. In event receiver, I will update Created By /Modified By/Title metadata of list item.
&lt;/br&gt;
&lt;b&gt;Code:&lt;/b&gt;
&lt;/br&gt;
&lt;pre name="code" class="CSharp"&gt;

public override void ItemUpdated(SPItemEventProperties properties)
    {
        int userID=0;
        string userNTID = "WIN\AMITKUMAR";
        SPSecurity.RunWithElevatedPrivileges(delegate()
        {
        SPListItem CurrentItem = properties.ListItem;
        CurrentItem.Web.AllowUnsafeUpdates = true;
        CurrentItem.Web.Site.AllowUnsafeUpdates = true;
        // In the next statment i am updating CreatedBy(Author) filed with SystemAccount
        CurrentItem["Author"] = CurrentItem.Web.Site.SystemAccount.ID; //CreatedBy
        //We can also update CreatedBy(Author)/ModifiedBy(Editor) field with Any user account
         FindUserIDByNTID(userNTID, CurrentItem.Web.Site, ref userID);
         if (userID &gt; 0)
         {
            CurrentItem["Editor"] = userID; //ModifiedBy
         }
         else
         {
            CurrentItem["Editor"] = CurrentItem.Web.Site.SystemAccount.ID; //ModifiedBy
         }
        CurrentItem["Title"] = "Amit Kumar";
        CurrentItem.Update();
        CurrentItem.ParentList.Update();
        CurrentItem.Web.Update();
        CurrentItem.Web.AllowUnsafeUpdates = false;
        CurrentItem.Web.Site.AllowUnsafeUpdates = false;
        });
    }
public static void FindUserIDByNTID(string userNTID, SPSite site, ref int userID)
        {
          try
            {
              //--Check user NTID is null or not
              if (!string.IsNullOrEmpty(userNTID))
              {
               //--userNTID is not null
               //--then fetch ID of the user
               userID = site.RootWeb.AllUsers[userNTID].ID;
              }
              else
              {
               //--If userNTID is null
               userID = 0;
              }
          }
        catch (ArgumentException ex)
            {
              userID = 0;
            }
      catch (Exception ex)
      {
      userID = 0;
      }
     }
&lt;/pre&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-3366069355556986322?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/3366069355556986322/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=3366069355556986322" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3366069355556986322?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3366069355556986322?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/ztVEiOYLlNU/event-receiver-to-update-items-in-list.html" title="Event receiver to update an item's in list" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/10/event-receiver-to-update-items-in-list.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08HQHgzcCp7ImA9WhdbE08.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-4177340475415535342</id><published>2011-10-11T13:56:00.001+05:30</published><updated>2011-10-11T14:00:31.688+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-11T14:00:31.688+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Stringcomparison. InvariantCultureIgnoreCase" /><category scheme="http://www.blogger.com/atom/ns#" term="Distinct().ToArray()" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="unique array" /><category scheme="http://www.blogger.com/atom/ns#" term="Get distinct value" /><category scheme="http://www.blogger.com/atom/ns#" term="NET Framework 3.5" /><category scheme="http://www.blogger.com/atom/ns#" term="Get Unique Array" /><title>Get unique value from Array (String/Integer):</title><content type="html">&lt;b&gt;Problem:&lt;/b&gt; 
In one of my project, I am getting values from one datasource in the form of .net Array. In the .NET Framework 3.5 there is a function called Distinct(). This Distinct() function return unique values from Array. This function works fine in the case of integer array. In string array, it not able to handle case sensitivity. If all items in the string array in same case, then it will work fine. Due to this, I was facing problem in getting unique value from String Array.


&lt;b&gt;Resolution:
&lt;/b&gt;To Solve this problem, I have created functions, which used Stringcomparison. InvariantCultureIgnoreCase.

&lt;b&gt;.NET Framework 3.5:
&lt;/b&gt;It is one line of code.

&lt;pre name="code" class="CSharp"&gt;
//If integer array
int [] intArr={5,2,3,3,5};
intArr = intArr.Distinct().ToArray(); // Output : intArr ={5,2,3}
//If string array
string [] strArr={“Amit”,”Amit”,”Kumar”,”Kumar”};
strArr = strArr.Distinct().ToArray(); //Output: strArr ={“Amit”,,”Kumar” }
string [] strArrCase={“Amit”,”AMIT”,”Kumar”,”KUMAR”,”Amit”,”Kumar”};
strArrCase = strArrCase.Distinct().ToArray(); //Output: strArrCase ={“Amit”,”AMIT”,”Kumar”,”KUMAR” }
&lt;/pre&gt;

&lt;b&gt;Custom Function:&lt;/b&gt;
&lt;pre name="code" class="CSharp"&gt;
//Function call
string [] strArr={“Amit”,”Amit”,”Kumar”,”Kumar”};
strArr= GetUniqueArray(strArr); //Output: strArr ={“Amit”,”Kumar” }
        #region Get unique From Array
        public static string[] GetUniqueArray(string[] itemValues)
        {
            string stringList=string.Empty;
            string currentValue=string.Empty;
            string[] newArray=null;
            ArrayList uniqueList = new ArrayList();
            try
            {
                for (int counter = 0; counter &lt; itemValues.Length; counter++)
                {
                    currentValue = Convert.ToString(itemValues[counter]);
                    if (!CheckDuplicateArray(currentValue, uniqueList))
                    {
                       uniqueList.Add(itemValues[counter]);
                    }
                }
                if (uniqueList.Count != 0)
                {
                    newArray = uniqueList.ToArray(Type.GetType("System.String")) as string[]; 
                }
            }
            catch (Exception ex)
            {
            }
            return newArray;
        }
        #endregion

        #region Check Duplicates From Array
        public static bool CheckDuplicateArray(string value, ArrayList uniqueList)
        {
            bool itemFound = false;
            try
            {
                foreach (string currentValue in uniqueList)
                {
                    if (string.Equals(value, currentValue, StringComparison.InvariantCultureIgnoreCase))
                    {
                        itemFound = true;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return itemFound;
        }
        #endregion
&lt;/pre&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-4177340475415535342?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/4177340475415535342/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=4177340475415535342" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4177340475415535342?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4177340475415535342?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/otgeKrMHtAw/get-unique-value-from-array.html" title="Get unique value from Array (String/Integer):" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/10/get-unique-value-from-array.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcERHY8fyp7ImA9WhdWEkQ.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-9114186496440498602</id><published>2011-09-06T12:15:00.004+05:30</published><updated>2011-09-06T12:23:25.877+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-06T12:23:25.877+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="System.Xml;System.Xml.Xsl;XSLT;Render XML;XsltView;XmlDocument.LoadXml;XslTransform.Load;amit kumar;XSL Transformations" /><title>Render(Parse) XML using XSLT</title><content type="html">&lt;b&gt;Requirement:
&lt;/b&gt;
&lt;/br&gt;
The requirement is to render xml data into a page.
&lt;/br&gt;
&lt;b&gt;Resolution:&lt;/b&gt;
&lt;/br&gt;
We can perform this task by following ways:
&lt;/br&gt;
1.	Read xml file using C#.Net and iterate the xml node. At the time of iteration, render data from xml to page.
&lt;/br&gt;
2.	Use the XSL. In this approach, create .XSLT file, which store the formatting in the form of HTML/CSS. By using XSL, we can separate the data rending from the data itself. 
&lt;/br&gt;

&lt;b&gt;Example to render (parse) xml using xslt:&lt;/b&gt;
&lt;/br&gt;
Save given xml in to file called "myNavigation.xslt":
&lt;/br&gt;

&lt;pre name="code" class="CSharp"&gt;

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
&gt;
  &lt;xsl:template match="/"&gt;
    &lt;div &gt;
      &lt;ul&gt;
        &lt;xsl:for-each select="LANGUAGES/LANGUAGETITLE/LANGUAGE"&gt;
          &lt;xsl:variable name="LANGUAGENAME" select="@Name" /&gt;
          &lt;xsl:variable name="Rows" select="LANGUAGEOPTION" /&gt;
          &lt;xsl:variable name="RowCount" select="count($Rows)" /&gt;
          &lt;xsl:variable name="IsEmpty" select="$RowCount = 0" /&gt;
          &lt;li class="sep"&gt;&lt;/li&gt;
          &lt;li id="LANGUAGE_{position()}" class="links" &gt;
            &lt;a href="javascript:void(0);"&gt;
              &lt;xsl:value-of select="@Name"/&gt;
            &lt;/a&gt;
            &lt;xsl:if test="not($IsEmpty)"&gt;
              &lt;div &gt;
                &lt;div&gt;
                  &lt;div &gt;&lt;/div&gt;
                  &lt;div &gt;
                    &lt;ul&gt;
                      &lt;xsl:for-each select="LANGUAGEOPTION"&gt;
                        &lt;xsl:variable name="LANGUAGEOPTIONUrl" select="@URL" /&gt;
                        &lt;li&gt;
                          &lt;xsl:choose&gt;
                            &lt;xsl:when test="string-length($LANGUAGEOPTIONUrl) != 0" &gt;
                              &lt;a href="{$LANGUAGEOPTIONUrl}" &gt;
                                &lt;xsl:value-of select="@Name"/&gt;
                              &lt;/a&gt;
                            &lt;/xsl:when&gt;
                            &lt;xsl:otherwise&gt;
                              &lt;xsl:value-of select="@Name"/&gt;
                            &lt;/xsl:otherwise&gt;
                          &lt;/xsl:choose&gt;
                        &lt;/li&gt;
                      &lt;/xsl:for-each&gt;
                      &lt;li &gt;
                        &lt;span &gt;
                          &lt;xsl:value-of select="$LANGUAGENAME"/&gt;
                        &lt;/span&gt;
                      &lt;/li&gt;
                    &lt;/ul&gt;
                  &lt;/div&gt;
                  &lt;div &gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/xsl:if&gt;
          &lt;/li&gt;
        &lt;/xsl:for-each&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  &lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;

&lt;/pre&gt;
&lt;/br&gt;

Now add following tag in your .ASPX page:
&lt;/br&gt;

&lt;pre name="code" class="CSharp"&gt;
&lt;asp:Xml ID="myNavigationControl" runat="server"&gt;&lt;/asp:Xml&gt;
&lt;/pre&gt;

&lt;/br&gt;

In the code behind file of .ASPX page (.ASPX.CS file), add following directive: 
&lt;/br&gt;

&lt;pre name="code" class="CSharp"&gt;
using System.Xml;
using System.Xml.Xsl;
&lt;/pre&gt;

&lt;/br&gt;
After that,in the code behind file of .ASPX page (.ASPX.CS file), write following code in the Page_Load method:
&lt;/br&gt;
&lt;pre name="code" class="CSharp"&gt;

string languageDetails =
 @"&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;
    &lt;LANGUAGES&gt;
        &lt;LANGUAGETITLE Name='Language Details'&gt;
            &lt;LANGUAGE Name='Worldwide (English)' URL='www.google.com/en-US' DisplayName=''&gt;
                &lt;LANGUAGEOPTION Name='Option1' DisplayName='' URL='http://' /&gt;
                &lt;LANGUAGEOPTION Name='Option2' DisplayName='' URL='http://' /&gt;
                &lt;LANGUAGEOPTION Name='Option3' DisplayName='' URL='http://' /&gt;
            &lt;/LANGUAGE&gt;
            &lt;LANGUAGE Name='China - 中国' URL='www.google.comwww.google.com/zh-CN' DisplayName=''&gt;
                &lt;LANGUAGEOPTION Name='Option4' DisplayName='' URL='http://' /&gt;
                &lt;LANGUAGEOPTION Name='Option5' DisplayName='' URL='http://' /&gt;
            &lt;/LANGUAGE&gt;
            &lt;LANGUAGE Name='Japan - 日本' URL='www.google.com/ja-JP' DisplayName=''&gt;
            &lt;/LANGUAGE&gt;
            &lt;LANGUAGE Name='Singapore' URL='www.google.com/zh-SG' DisplayName=''&gt;
                &lt;LANGUAGEOPTION Name='Option6' DisplayName='' URL='http://' /&gt;
                &lt;LANGUAGEOPTION Name='Option7' DisplayName='' URL='http://' /&gt;
                &lt;LANGUAGEOPTION Name='Option8' DisplayName='' URL='http://' /&gt;
                &lt;LANGUAGEOPTION Name='Option9' DisplayName='' URL='http://' /&gt;
                &lt;LANGUAGEOPTION Name='Option10' DisplayName='' URL='http://' /&gt;
            &lt;/LANGUAGE&gt;  
            &lt;LANGUAGE Name='Australia' URL='www.google.com/en-AU' DisplayName=''&gt;
            &lt;/LANGUAGE&gt;
            &lt;LANGUAGE Name='Malaysia' URL='www.google.com/ms-MY' DisplayName=''&gt;  
            &lt;/LANGUAGE&gt;
        &lt;/LANGUAGETITLE&gt;
     &lt;/LANGUAGES&gt; ";
XmlDocument myNavigationDoc = new XmlDocument();
myNavigationDoc.LoadXml(languageDetails);

XslTransform myNavigationTransform = new XslTransform();
myNavigationTransform.Load(Server.MapPath("myNavigation.xslt"));

this.myNavigationControl.Document = myNavigationDoc;
this.myNavigationControl.Transform = myNavigationTransform;

&lt;/pre&gt;

&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-9114186496440498602?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/9114186496440498602/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=9114186496440498602" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/9114186496440498602?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/9114186496440498602?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/0wrwb_0loAs/renderparse-xml-using-xslt.html" title="Render(Parse) XML using XSLT" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/09/renderparse-xml-using-xslt.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkAGRnwzfyp7ImA9WhdWEkU.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-1113264479189346443</id><published>2011-09-06T11:16:00.001+05:30</published><updated>2011-09-06T11:28:47.287+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-06T11:28:47.287+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="XDocument;XmlDocument;System.Xml.Linq;LINQ to XML;write XML;.Load;read XML;amit kumar;.NET Language-Integrated Query for XML Data" /><title>How to read XML using LINQ</title><content type="html">LINQ is a set of extensions to the .NET Framework that encompass language-integrated query, set, and transform operations. It extends C# and Visual Basic with native language syntax for queries and provides class libraries to take advantage of these capabilities.
&lt;br/&gt;
One of the big programming model improvements being made in .NET 3.5 is LINQ. "LINQ", stands for .NET Language Integrated Query.  
&lt;br/&gt;
LINQ supports a rich extensibility model that facilitates the creation of efficient domain-specific providers for data sources.  .NET 3.5 ships with built-in libraries that enable LINQ support against Objects, XML, and Databases.
&lt;br/&gt;
&lt;b&gt;“Microsoft original motivation behind LINQ was to address the impedance mismatch between programming languages and database.”
&lt;/b&gt;
&lt;br/&gt;
&lt;b&gt;What is LINQ to XML?
&lt;/b&gt;
&lt;br/&gt;
LINQ to XML is a built-in LINQ data provider that is implemented within the "System.Xml.Linq" namespace in .NET 3.5. Formerly LINQ is XLinq. It means Queries performed against the XML source.
LINQ to XML provides a clean programming model that enables you to read, construct and write XML data.  You can use LINQ to XML to perform LINQ queries over XML that you retrieve from the file-system, from a remote HTTP URL or web-service, or from any in-memory XML content.  
&lt;br/&gt;
&lt;b&gt;Using LINQ to XML to read XML file:
&lt;/b&gt;
&lt;br/&gt;
&lt;pre name="code" class="CSharp"&gt;
using System;
using System.Xml.Linq;
using System.Text;

namespace ReadXMLData
{
  class Program  
	{
		static void Main(string[] args)
		{
			DisplayXmlData();

		}

public static void DisplayXmlData()
{
string languageDetails =

  @"&lt;?xml version=""1.0"" encoding=""utf-8""?&gt;&lt;Languages&gt;  &lt;LanguageTitle Name='Language Details'/&gt;  &lt;Language Name='Worldwide (English)' DisplayName='' URL='www.google.com/en-US'&gt;  &lt;/Language&gt;  &lt;Language Name='China - 中国' DisplayName='' URL='www.google.comwww.google.com/zh-CN'&gt;  &lt;/Language&gt;  &lt;Language Name='Japan - 日本' DisplayName='' URL='www.google.com/ja-JP'&gt;  &lt;/Language&gt;  &lt;Language Name='Singapore' DisplayName='' URL='www.google.com/zh-SG'&gt;  &lt;/Language&gt;  &lt;Language Name='Australia' DisplayName='' URL='www.google.com/en-AU'&gt;  &lt;/Language&gt;  &lt;Language Name='Malaysia' DisplayName='' URL='www.google.com/ms-MY'&gt;  &lt;/Language&gt;&lt;/Languages&gt; ";

////Create XDocument object using string.
XDocument xmlDoc = XDocument.Parse(languageDetails);
/*
////Load XDocument object using xml document/file:
string xmlPath=""; //// Complete path of xml
XDocument xmlDoc = XDocument.Load(xmlPath);
*/
string languageTitle=GetLanguageTitle(xmlDoc);

////Find language xml

List&lt;XElement&gt; languagesXml = GetLanguageXml(xmlDoc);

if (languagesXml != null)
     {
      ////Loop of language xml :: Begins
      foreach (XElement languageXml in languagesXml)
      {

       Console.WriteLine(languageXml.Attribute("URL").Value);
       Console.WriteLine(languageXml.Attribute("Name").Value);
      }
      ////Loop of language xml :: Ends
     }
}


 public static string GetLanguageTitle(XDocument xmlDoc)
  {
   string languageTitle = string.Empty;

   try
   {

    List&lt;XElement&gt; objXElements = new List&lt;XElement&gt;();
    objXElements = (from localeXml in xmlDoc.Descendants("LanguageTitle")
        select localeXml).ToList&lt;XElement&gt;();

    if (objXElements != null)
    {
     languageTitle = objXElements[0].Attribute("Name").Value;
    }
   }
   catch (Exception ex)
   {

   }

   return languageTitle;
  }


  public static List&lt;XElement&gt; GetLanguageXml(XDocument xmlDoc)
  {
   List&lt;XElement&gt; objXElements = new List&lt;XElement&gt;();

   try
   {

    objXElements = (from localeXml in xmlDoc.Descendants("Language")
        select localeXml).ToList&lt;XElement&gt;();
   }
   catch (Exception ex)
   {

   }

   return objXElements;
  }

        }
}

&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-1113264479189346443?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/1113264479189346443/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=1113264479189346443" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/1113264479189346443?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/1113264479189346443?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/vhYgoSKsJM0/how-to-read-xml-using-linq.html" title="How to read XML using LINQ" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/09/how-to-read-xml-using-linq.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8DRns7eip7ImA9WhZaFUw.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-3689296921422234586</id><published>2011-07-01T15:13:00.002+05:30</published><updated>2011-07-01T15:21:17.502+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-01T15:21:17.502+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Example of Link Tag" /><category scheme="http://www.blogger.com/atom/ns#" term="A Tag" /><category scheme="http://www.blogger.com/atom/ns#" term="CSS" /><category scheme="http://www.blogger.com/atom/ns#" term="Style Sheet" /><category scheme="http://www.blogger.com/atom/ns#" term="HREF tag" /><category scheme="http://www.blogger.com/atom/ns#" term="HTML" /><category scheme="http://www.blogger.com/atom/ns#" term="HTML Link Tag" /><title>Highlight the link(href Tag/HTML link Tag) on click:</title><content type="html">&lt;strong&gt;Highlight the link(href Tag/HTML link Tag) on click:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;With the help of style sheet(CSS), we can highlight the link after click.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Write below mentioned styles in STYLE tag before HEAD Tag of page:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;a:link {font-size: 11px;color:green;text-decoration: none}    /* unvisited link */&lt;br /&gt;a:visited {font-size: 11px;orange:orange;text-decoration: none} /* visited link */&lt;br /&gt;a:hover {font-size: 11px;text-decoration: underline;color:#FF00FF;}   /* mouse over link */&lt;br /&gt;a:active {font-size: 11px;color:orange;text-decoration: none}  /* selected link */&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Write below mentioned HTML in BODY Tag of page:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href='http://amitkumarmca04.blogspot.com/'  target='_blank'&gt;Amit Kumar1&lt;/a&gt;&lt;br /&gt;&lt;/BR&gt;&lt;br /&gt;&lt;a href='http://amitkumarmca04.blogspot.com/'  target='_blank'&gt;Amit Kumar2&lt;/a&gt;&lt;br /&gt;&lt;/BR&gt;&lt;br /&gt;&lt;a href='http://amitkumarmca04.blogspot.com/'  target='_blank'&gt;Amit Kumar3&lt;/a&gt;&lt;br /&gt;&lt;/BR&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-3689296921422234586?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/3689296921422234586/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=3689296921422234586" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3689296921422234586?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3689296921422234586?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/wNnTa6WxbKQ/highlight-linkhref-taghtml-link-tag-on.html" title="Highlight the link(href Tag/HTML link Tag) on click:" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/07/highlight-linkhref-taghtml-link-tag-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0MEQHg8eip7ImA9WhZaFU0.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-4692313246093252280</id><published>2011-07-01T12:50:00.002+05:30</published><updated>2011-07-01T13:00:01.672+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-01T13:00:01.672+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PublishingWeb" /><category scheme="http://www.blogger.com/atom/ns#" term="Pages" /><category scheme="http://www.blogger.com/atom/ns#" term="SPListItem.ModerationInformation.Status" /><category scheme="http://www.blogger.com/atom/ns#" term="Metadata" /><category scheme="http://www.blogger.com/atom/ns#" term="SPWeb" /><category scheme="http://www.blogger.com/atom/ns#" term="Publishing.PublishingPage.GetPublishingPage" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint.Publishing" /><category scheme="http://www.blogger.com/atom/ns#" term="Publishing.PublishingPage.IsPublishingPage" /><category scheme="http://www.blogger.com/atom/ns#" term="SPListtem.Level" /><title>How to get Publishing Page Meta Data (Column Value) in Sharepoint</title><content type="html">&lt;strong&gt;Requirement:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The requirement is to identify status (Draft/Approved/Checkout/Pending/Published) of page in Pages library and also fetch the metadata of page  using SharePoint Ojbect Model in Publishing Web.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Resolution:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;With the help of PublishingWeb class (Microsoft.SharePoint.Publishing), we can access different components of Published Web site like Pages document library, Published site navigation bar and etc.&lt;br /&gt;&lt;br /&gt;The PublishingWeb class provides publishing behavior for an SPWeb instance that supports publishing. This class cannot be inherited. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Namespace: Microsoft.SharePoint.Publishing&lt;br /&gt;Assembly: Microsoft.SharePoint.Publishing (in microsoft.sharepoint.publishing.dll)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In this example we will identify status (Draft/Approved/Checkout/Pending/Published) of page and access metadata of Pages from Pages Library in Publishing Web:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.Office.Server;&lt;br /&gt;using Microsoft.Office.Server.Administration;&lt;br /&gt;using Microsoft.Office.Server.UserProfiles;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using System.Web;&lt;br /&gt;using Microsoft.SharePoint.Navigation;&lt;br /&gt;using Microsoft.SharePoint.Publishing;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;namespace GetPublishedData&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;try&lt;br /&gt;            {&lt;br /&gt;&lt;br /&gt;using (SPSite site = new SPSite("http://amitkumarmca04.blogspot.com"))&lt;br /&gt;                {&lt;br /&gt;                    using (SPWeb web = site.OpenWeb())&lt;br /&gt;                    {&lt;br /&gt;                        // Check web is PublishingWeb or not&lt;br /&gt;                        if (PublishingWeb.IsPublishingWeb(web))&lt;br /&gt;                        {&lt;br /&gt;                            // Get the PublishingWeb &lt;br /&gt;                            PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);&lt;br /&gt;                            // Get the Page list from PublishingWeb&lt;br /&gt;                            SPList pagesList = publishingWeb.PagesList;&lt;br /&gt;                            if (pagesList != null &amp;&amp; pagesList.Items.Count &gt; 0)&lt;br /&gt;                            {&lt;br /&gt;                                // Get a reference to a publishing page&lt;br /&gt;&lt;br /&gt;                                foreach (SPListItem page in pagesList.Items)&lt;br /&gt;                                {&lt;br /&gt;                                    //Find status (Draft/Approved/Checkout/Pending/Published) of page&lt;br /&gt;                                    if (page.ModerationInformation.Status == SPModerationStatusType.Draft)&lt;br /&gt;                                    {&lt;br /&gt;                                        Console.WriteLine("Page in Draft mode.");&lt;br /&gt;                                    }&lt;br /&gt;                                    else if (page.ModerationInformation.Status == SPModerationStatusType.Approved)&lt;br /&gt;                                    {&lt;br /&gt;                                        Console.WriteLine("Page in Approved mode.");&lt;br /&gt;                                    }&lt;br /&gt;                                    else if (page.ModerationInformation.Status == SPModerationStatusType.Pending)&lt;br /&gt;                                    {&lt;br /&gt;                                        Console.WriteLine("Page in Pendig mode.");&lt;br /&gt;                                    }&lt;br /&gt;&lt;br /&gt;                                    if (page.Level == SPFileLevel.Checkout)&lt;br /&gt;                                    {&lt;br /&gt;                                        Console.WriteLine("Page in Checkout mode.");&lt;br /&gt;                                    }&lt;br /&gt;                                    else if (page.Level == SPFileLevel.Published)&lt;br /&gt;                                    {&lt;br /&gt;                                        Console.WriteLine("Page in Published mode.");&lt;br /&gt;                                    }&lt;br /&gt;                                    else if (page.Level == SPFileLevel.Draft)&lt;br /&gt;                                    {&lt;br /&gt;                                        Console.WriteLine("Page in Draft mode.");&lt;br /&gt;                                    }&lt;br /&gt;&lt;br /&gt;                                    //Find metadata of page&lt;br /&gt;                                    if (string.Equals(page.Name, "AmitKumar.aspx", StringComparison.InvariantCultureIgnoreCase))&lt;br /&gt;                                    {&lt;br /&gt;                                        //Access the page metadata&lt;br /&gt;                                        Console.WriteLine(Convert.ToString(page["Title"]));&lt;br /&gt;                                    }&lt;br /&gt;                                }&lt;br /&gt;                            }&lt;br /&gt;                        }&lt;br /&gt;                        else&lt;br /&gt;                        {&lt;br /&gt;                            // If the SPWeb is not a PublishingWeb, &lt;br /&gt;                            // then GetPagesListName returns the URL&lt;br /&gt;                            // that would be used by the Pages list &lt;br /&gt;                            // if the Publishing feature were to be&lt;br /&gt;                            // activated.&lt;br /&gt;                            string pagesListName = PublishingWeb.GetPagesListName(web);&lt;br /&gt;                            //After getting the url we can access Pages list&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                throw;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-4692313246093252280?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/4692313246093252280/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=4692313246093252280" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4692313246093252280?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4692313246093252280?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/6_5Bpkgw6RA/how-to-get-publishing-page-meta-data.html" title="How to get Publishing Page Meta Data (Column Value) in Sharepoint" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/07/how-to-get-publishing-page-meta-data.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEEASX8-fSp7ImA9WhZUFEk.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-2634411807049762378</id><published>2011-06-07T15:55:00.002+05:30</published><updated>2011-06-07T16:00:48.155+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-07T16:00:48.155+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SPList.Upate()" /><category scheme="http://www.blogger.com/atom/ns#" term="Office.Microsoft.com" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="Spreadsheet" /><category scheme="http://www.blogger.com/atom/ns#" term="Publishing and Synchronizing Excel 2007" /><category scheme="http://www.blogger.com/atom/ns#" term="List.Items.Add" /><category scheme="http://www.blogger.com/atom/ns#" term="Export/Import excel file" /><title>Upload (Import) data from excel (spreadsheet) file to SharePoint list using c#</title><content type="html">Upload (Import) data from excel (spreadsheet) file to SharePoint list using c#:&lt;br /&gt;&lt;br /&gt;When we have data in excel format and want to import that data to a SharePoint list, then how to do. By default SharePoint will provide us an option to edit in spreadsheet or download list items in spread sheet. But, it doesn't have an option to import the excel data to SharePoint list. To resolve this problem, I have created web part. &lt;br /&gt;In this web part, I am using SharePoint list called “Employee”. The name of columns are Tile and LastName.&lt;br /&gt;With the help of this web part, user will enter the data in the excel and then give the path of the file in the input box present in the page. Now instead of uploading the whole excel file into a document library the code will read the file and update the list with the data present in the excel file.&lt;br /&gt;&lt;br /&gt;The web part code is:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Xml;&lt;br /&gt;using System.Xml.Serialization;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data.OleDb;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using Microsoft.SharePoint.WebPartPages;&lt;br /&gt;using Microsoft.SharePoint.WebControls;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;namespace Example1&lt;br /&gt;{&lt;br /&gt;    public class wp_ImportXLSFile : WebPart&lt;br /&gt;    {&lt;br /&gt;        #region Member Variables&lt;br /&gt;        System.Web.UI.WebControls.Button btnUpload;&lt;br /&gt;        FileUpload fleDoc;&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;        #region Properties&lt;br /&gt;        private const string _defaultList = "Employee";&lt;br /&gt;        private string _listName = "Employee";&lt;br /&gt;        [DefaultValue(_defaultList)]&lt;br /&gt;        [WebPartStorage(Storage.Personal)]&lt;br /&gt;        [XmlElement(ElementName = "List Name", IsNullable = false)]&lt;br /&gt;        public string InternalList&lt;br /&gt;        {&lt;br /&gt;            get { return this._listName; }&lt;br /&gt;            set { this._listName = value; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;         #endregion&lt;br /&gt;&lt;br /&gt;        #region Render Controls and Handle Controls Event&lt;br /&gt;&lt;br /&gt;        #region Create Child Controls&lt;br /&gt;        protected override void CreateChildControls()&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                Table tbl = new Table();&lt;br /&gt;                TableRow tr = new TableRow();&lt;br /&gt;                TableCell tc = new TableCell();&lt;br /&gt;&lt;br /&gt;                tc.Text = "Select file:";&lt;br /&gt;                tr.Cells.Add(tc);&lt;br /&gt;                tc = new TableCell();&lt;br /&gt;                //Create browse object&lt;br /&gt;                fleDoc = new FileUpload();&lt;br /&gt;                tc.Controls.Add(fleDoc);&lt;br /&gt;                tr.Cells.Add(tc);&lt;br /&gt;                tbl.Rows.Add(tr);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                tr = new TableRow();&lt;br /&gt;                tc = new TableCell();&lt;br /&gt;                tc.RowSpan = 2;&lt;br /&gt;                tc.HorizontalAlign = HorizontalAlign.Center;&lt;br /&gt;                //Create button&lt;br /&gt;                btnUpload = new System.Web.UI.WebControls.Button();&lt;br /&gt;                btnUpload.Text = "Upload File";&lt;br /&gt;                btnUpload.Click += new EventHandler(btnUpload_Click);&lt;br /&gt;                tc.Controls.Add(btnUpload);&lt;br /&gt;                tr.Cells.Add(tc);&lt;br /&gt;                tbl.Rows.Add(tr);&lt;br /&gt;                this.Controls.Add(tbl);&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                this.Page.Response.Write(ex.Message);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;        #region Handle button click event&lt;br /&gt;        void btnUpload_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                if (fleDoc != null &amp;&amp; fleDoc.PostedFile != null)&lt;br /&gt;                {&lt;br /&gt;                    #region If File exist&lt;br /&gt;&lt;br /&gt;                    if (fleDoc.PostedFile.ContentLength &gt; 0)&lt;br /&gt;                    {&lt;br /&gt;                        #region File size is greater than 0&lt;br /&gt;                        &lt;br /&gt;                        string fileExt = System.IO.Path.GetExtension(fleDoc.FileName);&lt;br /&gt;                        if (string.Equals(fileExt, ".xls", StringComparison.InvariantCultureIgnoreCase) )&lt;br /&gt;                        {&lt;br /&gt;                            #region If not xls file&lt;br /&gt;                            string Path = fleDoc.PostedFile.FileName;&lt;br /&gt;                            string listname = "Sheet1";&lt;br /&gt;&lt;br /&gt;                            OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Path + ";Extended Properties=Excel 8.0");&lt;br /&gt;                            //OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Path + ";Extended Properties=Excel 12.0 Xml;HDR=YES");&lt;br /&gt;                            //Provider=Microsoft.ACE.OLEDB.12.0;Data Source=;Extended Properties="Excel 12.0;HDR=YES";&lt;br /&gt;                            //Provider=Microsoft.ACE.OLEDB.12.0;Data Source=;Extended Properties="Excel 12.0 Xml;HDR=YES";&lt;br /&gt;                            con.Open();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                            //Create Dataset and fill with imformation from the Excel Spreadsheet for easier reference&lt;br /&gt;                            DataSet myDataSet = new DataSet();&lt;br /&gt;                            OleDbCommand myCommand = new OleDbCommand(" SELECT * FROM [" + listname + "$]", con);&lt;br /&gt;                            System.Data.OleDb.OleDbDataAdapter da = new OleDbDataAdapter(myCommand);&lt;br /&gt;&lt;br /&gt;                            da.Fill(myDataSet);&lt;br /&gt;                            con.Close();&lt;br /&gt;&lt;br /&gt;                            if (myDataSet != null &amp;&amp; myDataSet.Tables.Count &gt; 0 &amp;&amp; myDataSet.Tables[0].Rows.Count &gt; 0 &amp;&amp; !string.IsNullOrEmpty(this.InternalList))&lt;br /&gt;                            {&lt;br /&gt;                                #region If record found&lt;br /&gt;&lt;br /&gt;                                SPWeb web = SPContext.Current.Web;&lt;br /&gt;&lt;br /&gt;                                SPSecurity.RunWithElevatedPrivileges(delegate&lt;br /&gt;                                                    {&lt;br /&gt;                                                        using (SPSite fullSite = new SPSite(web.Site.ID))&lt;br /&gt;                                                        {&lt;br /&gt;                                                            using (SPWeb fullWeb = fullSite.OpenWeb())&lt;br /&gt;                                                            {&lt;br /&gt;&lt;br /&gt;                                                                #region Find list exist or not&lt;br /&gt;                                                                if (chkListExist(fullWeb))&lt;br /&gt;                                                                {&lt;br /&gt;                                                                    fullWeb.AllowUnsafeUpdates = true;&lt;br /&gt;                                                                    SPList oList = fullWeb.Lists[this.InternalList];&lt;br /&gt;&lt;br /&gt;                                                                    #region Travers through each row in the dataset&lt;br /&gt;                                                                    foreach (DataRow myDataRow in myDataSet.Tables[0].Rows)&lt;br /&gt;                                                                    {&lt;br /&gt;                                                                        #region Datarow Loop&lt;br /&gt;                                                                        Object[] cells = myDataRow.ItemArray;&lt;br /&gt;                                                                        string strFirstName = string.Empty;&lt;br /&gt;                                                                        string strLastName = string.Empty;&lt;br /&gt;                                                                        int cellCount = 1;&lt;br /&gt;                                                                        foreach (object cellContent in cells)&lt;br /&gt;                                                                        {&lt;br /&gt;                                                                            #region Cell Loop&lt;br /&gt;&lt;br /&gt;                                                                            string cellText = cellContent.ToString();&lt;br /&gt;                                                                            cellText = cellText.Replace("\n", "|");&lt;br /&gt;                                                                            //Read the string and put into Array of characters chars&lt;br /&gt;                                                                            if (cellCount == 1)&lt;br /&gt;                                                                            {&lt;br /&gt;                                                                                strFirstName = cellText;&lt;br /&gt;                                                                                cellCount++;&lt;br /&gt;                                                                            }&lt;br /&gt;                                                                            else if (cellCount == 2)&lt;br /&gt;                                                                            {&lt;br /&gt;                                                                                strLastName = cellText;&lt;br /&gt;                                                                                cellCount = 1;&lt;br /&gt;                                                                            }&lt;br /&gt;                                                                            this.Page.Response.Write("\n" + cellText);&lt;br /&gt;                                                                            #endregion&lt;br /&gt;                                                                        }&lt;br /&gt;                                                                        insertRecordInList(oList, strFirstName, strLastName);&lt;br /&gt;                                                                        #endregion&lt;br /&gt;                                                                    }&lt;br /&gt;                                                                    #endregion&lt;br /&gt;&lt;br /&gt;                                                                    fullWeb.AllowUnsafeUpdates = false;&lt;br /&gt;&lt;br /&gt;                                                                }&lt;br /&gt;                                                                &lt;br /&gt;                                                                #endregion&lt;br /&gt;&lt;br /&gt;                                                            }&lt;br /&gt;                                                        }&lt;br /&gt;                                                    });&lt;br /&gt;&lt;br /&gt;                                #endregion&lt;br /&gt;                            }&lt;br /&gt;                            else&lt;br /&gt;                            {&lt;br /&gt;                                #region If record not found&lt;br /&gt;                                this.Page.Response.Write("No record found.");&lt;br /&gt;                                #endregion&lt;br /&gt;                            }&lt;br /&gt;                            #endregion&lt;br /&gt;&lt;br /&gt;                        }&lt;br /&gt;                        else&lt;br /&gt;                        {&lt;br /&gt;                            #region If not xls file&lt;br /&gt;                            this.Page.Response.Write("Only .xls files allowed!");&lt;br /&gt;                            #endregion&lt;br /&gt;                        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                        #endregion&lt;br /&gt;                    }&lt;br /&gt;                    else&lt;br /&gt;                    {&lt;br /&gt;                        #region File size is 0&lt;br /&gt;                        this.Page.Response.Write("Uploaded file size is 0.");&lt;br /&gt;                        #endregion&lt;br /&gt;                    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                    #endregion&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    #region If File not exist&lt;br /&gt;                    this.Page.Response.Write("Uploaded file does not exist.");&lt;br /&gt;                    #endregion&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                throw ex;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;        #region Helper&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        #region Check list exist or not&lt;br /&gt;        private Boolean chkListExist(SPWeb web)&lt;br /&gt;        {&lt;br /&gt;            Boolean blnExist = false;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                #region Try&lt;br /&gt;                if (!String.IsNullOrEmpty(this.InternalList) &amp;&amp; this.InternalList.ToString().Trim().Length != 0)&lt;br /&gt;                {&lt;br /&gt;                    try&lt;br /&gt;                    {&lt;br /&gt;                        if (web.Lists[this.InternalList] != null)&lt;br /&gt;                        {&lt;br /&gt;                            blnExist =  true;&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                    catch&lt;br /&gt;                    {&lt;br /&gt;                        #region If internal news list name is not valid&lt;br /&gt;                        blnExist = false;&lt;br /&gt;                        #endregion&lt;br /&gt;&lt;br /&gt;                    }&lt;br /&gt;&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    #region If internal news list name is empty&lt;br /&gt;                    blnExist = false;&lt;br /&gt;                    #endregion&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;                #endregion&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                #region Catch&lt;br /&gt;                blnExist = false;&lt;br /&gt;                #endregion&lt;br /&gt;            }&lt;br /&gt;            return blnExist;&lt;br /&gt;        }&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        #region Insert record in list&lt;br /&gt;        private void insertRecordInList(SPList oList,string strFirstName,string strLastName)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                #region Try&lt;br /&gt;                SPListItem oListItem = oList.Items.Add();&lt;br /&gt;                oListItem["Title"] = strFirstName;&lt;br /&gt;                oListItem["LastName"] = strLastName;&lt;br /&gt;                oListItem.Update();&lt;br /&gt;                #endregion&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                #region Catch&lt;br /&gt;                throw ex;&lt;br /&gt;                #endregion&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;        #endregion&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-2634411807049762378?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/2634411807049762378/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=2634411807049762378" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/2634411807049762378?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/2634411807049762378?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/-ca2GX81InM/upload-import-data-from-excel.html" title="Upload (Import) data from excel (spreadsheet) file to SharePoint list using c#" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/06/upload-import-data-from-excel.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcBQXw4fyp7ImA9WhZUE0g.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-6408451300888981422</id><published>2011-06-06T16:22:00.003+05:30</published><updated>2011-06-06T16:30:50.237+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-06T16:30:50.237+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UserProfileChangeQuery.ChangeTokenStart" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfileChangeCollection" /><category scheme="http://www.blogger.com/atom/ns#" term="TimeSpan" /><category scheme="http://www.blogger.com/atom/ns#" term="AccountName" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfileManager" /><category scheme="http://www.blogger.com/atom/ns#" term="User Properties" /><category scheme="http://www.blogger.com/atom/ns#" term="PropertyCollection" /><category scheme="http://www.blogger.com/atom/ns#" term="ServerContext" /><category scheme="http://www.blogger.com/atom/ns#" term="User Profile" /><category scheme="http://www.blogger.com/atom/ns#" term="UserProfileChangeQuery" /><title>Get changed user profiles in SharePoint using C#</title><content type="html">Get all the user profiles/properties which are modified since yesterday date or any datetime interval:&lt;br /&gt;&lt;br /&gt;With the help of UserProfileManager class (Microsoft.Office.Server.UserProfiles), we can access properties of user profile and changed profile which are modified since yesterday date or any datetime interval.&lt;br /&gt;In this example we will access different components of UserProfileManager :&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.Office.Server;&lt;br /&gt;using Microsoft.Office.Server.Administration;&lt;br /&gt;using Microsoft.Office.Server.UserProfiles;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Collections;&lt;br /&gt;&lt;br /&gt;namespace UserProfilesOMApp&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            using (SPSite site = new SPSite("http://amitkumarmca04.blogspot.com"))&lt;br /&gt;            {&lt;br /&gt;                ServerContext context = ServerContext.GetContext(site);&lt;br /&gt;                UserProfileManager profileManager =&lt;br /&gt;                  new UserProfileManager(context);&lt;br /&gt;&lt;br /&gt;                //Fetch all user profile properties &lt;br /&gt;                Microsoft.Office.Server.UserProfiles.PropertyCollection props = profileManager.Properties;&lt;br /&gt;                //Print all user profile properties&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                Console.WriteLine("_______________________Start:Print all user profile properties.");&lt;br /&gt;&lt;br /&gt;                foreach (Property prop in props)&lt;br /&gt;                {&lt;br /&gt;                    Console.WriteLine(prop.Name);&lt;br /&gt;                }&lt;br /&gt;                Console.WriteLine("_______________________End:Print all user profile properties.");&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;                //Find user profile changes.&lt;br /&gt;&lt;br /&gt;                // this gets some subset of changes to a user profile, changed 5 days before&lt;br /&gt;                DateTime startDate =&lt;br /&gt;                  DateTime.UtcNow.Subtract(TimeSpan.FromDays(5));&lt;br /&gt;&lt;br /&gt;                /* If we want to access changes after "4/30/2011 11:33:47 PM" then we can use below mentioned code:&lt;br /&gt;                 &lt;br /&gt;                 StartTime="5/30/2010 11:33:47 PM"&lt;br /&gt;                System.TimeSpan dateDiff = DateTime.UtcNow.Subtract(Convert.ToDateTime(StartTime));&lt;br /&gt;                DateTime startDate = DateTime.UtcNow.Subtract(dateDiff);&lt;br /&gt;                */&lt;br /&gt;&lt;br /&gt;                UserProfileChangeQuery changeQuery = new UserProfileChangeQuery(true, true);&lt;br /&gt;                changeQuery.ChangeTokenStart = new UserProfileChangeToken(startDate);&lt;br /&gt;                UserProfileChangeCollection changes = profileManager.GetChanges(changeQuery);&lt;br /&gt;                //Used to store unique user names&lt;br /&gt;                ArrayList arrLstUsers = new ArrayList();&lt;br /&gt;                foreach (UserProfileChange change in changes)&lt;br /&gt;                {&lt;br /&gt;                    if (arrLstUsers != null &amp;&amp; !arrLstUsers.Contains(change.AccountName))&lt;br /&gt;                    {&lt;br /&gt;                        //Add user to array list&lt;br /&gt;                        arrLstUsers.Add(change.AccountName);&lt;br /&gt;                        //Print chagned profile user name&lt;br /&gt;                        Console.Write(change.AccountName);&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;                Console.Read();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-6408451300888981422?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/6408451300888981422/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=6408451300888981422" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/6408451300888981422?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/6408451300888981422?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/ihevbb1nlE8/get-changed-user-profiles-in-sharepoint.html" title="Get changed user profiles in SharePoint using C#" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/06/get-changed-user-profiles-in-sharepoint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkcHRn44fip7ImA9WhZUE0g.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-7250262771358020888</id><published>2011-06-06T15:19:00.003+05:30</published><updated>2011-06-06T15:23:57.036+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-06T15:23:57.036+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="PublishingWeb" /><category scheme="http://www.blogger.com/atom/ns#" term="How access SharePoint Data" /><category scheme="http://www.blogger.com/atom/ns#" term="Global Navigation Menu Item" /><category scheme="http://www.blogger.com/atom/ns#" term="Publishing site Navigation" /><category scheme="http://www.blogger.com/atom/ns#" term="Publishing Pages" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft.SharePoint.Publishing;Accessing SharePoint Data" /><title>Accessing SharePoint Publishing site Navigation (Global Navigation bar) using C#</title><content type="html">Accessing SharePoint Publishing site Navigation (Global Navigation bar) using C#:&lt;br /&gt;&lt;br /&gt;With the help of PublishingWeb class (Microsoft.SharePoint.Publishing), we can access different components of Published Web site like Pages document library, Published site navigation bar and etc.&lt;br /&gt;In this example we will access different components of Published site:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.Office.Server;&lt;br /&gt;using Microsoft.Office.Server.Administration;&lt;br /&gt;using Microsoft.Office.Server.UserProfiles;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using System.Web;&lt;br /&gt;using Microsoft.SharePoint.Navigation;&lt;br /&gt;using Microsoft.SharePoint.Publishing;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;namespace GetPublishedData&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            using (SPSite site = new SPSite("http://amitkumarmca04.blogspot.com/"))&lt;br /&gt;            {&lt;br /&gt;                using (SPWeb web = site.RootWeb)&lt;br /&gt;                {&lt;br /&gt;                    PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);&lt;br /&gt;&lt;br /&gt;                    //Display Global Navigation menu items(Home &gt; Site Settings &gt; Modify Navigation)&lt;br /&gt;                    foreach (Microsoft.SharePoint.Navigation.SPNavigationNode node in publishingWeb.GlobalNavigationNodes)&lt;br /&gt;                    {&lt;br /&gt;&lt;br /&gt;                        Console.WriteLine(node.Title + " " + node.Url);&lt;br /&gt;&lt;br /&gt;                    }&lt;br /&gt;                    // Get the Id for the Pages list.&lt;br /&gt;                    Guid pagesListId = publishingWeb.PagesListId;&lt;br /&gt;                    SPList pagesList = publishingWeb.PagesList;&lt;br /&gt;&lt;br /&gt;                    // The PublishingWeb.PagesListName is equivalent &lt;br /&gt;                    // to PublishingWeb.PagesList.RootFolder.Url.&lt;br /&gt;                    string pagesListUrl = publishingWeb.PagesListName;&lt;br /&gt;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href='http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb(v=office.12).aspx' target='_blank'&gt;MSDN&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-7250262771358020888?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/7250262771358020888/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=7250262771358020888" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/7250262771358020888?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/7250262771358020888?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/LdOy-NWbZzg/accessing-sharepoint-publishing-site.html" title="Accessing SharePoint Publishing site Navigation (Global Navigation bar) using C#" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/06/accessing-sharepoint-publishing-site.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4CQH85fCp7ImA9WhZUE0g.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-8852140790676416014</id><published>2011-06-06T15:01:00.002+05:30</published><updated>2011-06-06T15:06:01.124+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-06T15:06:01.124+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SPNavigation.QuickLaunch" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft.SharePoint.Navigation" /><category scheme="http://www.blogger.com/atom/ns#" term="How access SharePoint Data" /><category scheme="http://www.blogger.com/atom/ns#" term="Accessing SharePoint Data" /><category scheme="http://www.blogger.com/atom/ns#" term="Quick Launch menu" /><category scheme="http://www.blogger.com/atom/ns#" term="SPNavigationNode" /><title>Accessing SharePoint Quick Launch menu (SPNavigation.QuickLaunch) using C#:</title><content type="html">&lt;strong&gt;Accessing SharePoint Quick Launch menu (SPNavigation.QuickLaunch) using C#:&lt;/strong&gt;&lt;br /&gt;With the help of  SPNavigation, we will be able to access the Quick Launch menu of SharePoint site. Sometimes we need to show/hide Quick Launch menu item, so with the help of SPNavigation. QuickLaunch, we can loop through Quick Launch menu item.&lt;br /&gt; In this example we will access Quick Launch menu:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.Office.Server;&lt;br /&gt;using Microsoft.Office.Server.Administration;&lt;br /&gt;using Microsoft.Office.Server.UserProfiles;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;using System.Web;&lt;br /&gt;using Microsoft.SharePoint.Navigation;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;namespace GetQuickLaunch&lt;br /&gt;{&lt;br /&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            using (SPSite site = new SPSite("http://amitkumarmca04.blogspot.com/"))&lt;br /&gt;            {&lt;br /&gt;                using (SPWeb web = site.OpenWeb())&lt;br /&gt;                {&lt;br /&gt;                    SPNavigationNodeCollection qlNodes = web.Navigation.QuickLaunch;&lt;br /&gt;                    foreach (SPNavigationNode node in qlNodes)&lt;br /&gt;                    {&lt;br /&gt;                        Console.WriteLine(node.Title + "--" + node.Url);&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href='http://msdn.microsoft.com/en-us/library/ms476638(v=office.12).aspx' target='_blank'&gt;MSDN&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-8852140790676416014?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/8852140790676416014/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=8852140790676416014" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/8852140790676416014?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/8852140790676416014?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/H0Ian1FRIs8/accessing-sharepoint-quick-launch-menu.html" title="Accessing SharePoint Quick Launch menu (SPNavigation.QuickLaunch) using C#:" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/06/accessing-sharepoint-quick-launch-menu.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUNRn0-fSp7ImA9WhZUEUo.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-2250189006749128136</id><published>2011-06-04T14:13:00.001+05:30</published><updated>2011-06-04T14:18:17.355+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-04T14:18:17.355+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WebPartPageUserException" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint(MOSS)" /><category scheme="http://www.blogger.com/atom/ns#" term="web part properties" /><category scheme="http://www.blogger.com/atom/ns#" term="Exception Handling" /><category scheme="http://www.blogger.com/atom/ns#" term="custom web part" /><category scheme="http://www.blogger.com/atom/ns#" term="custom validation" /><category scheme="http://www.blogger.com/atom/ns#" term="Customizing web part in SharePoint" /><title>SharePoint web parts properties validation</title><content type="html">&lt;span style="font-weight:bold;"&gt;SharePoint web parts properties validation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sometimes, in a custom web part we define the custom properties. It’s very difficult to validate properties every time by opening the web part in edit mode. So we needed to include validations on it so that whenever the user clicked OK or Apply the error message should be shown so that the correct input should be given.&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution  1&lt;/span&gt;:&lt;br /&gt; &lt;br /&gt;Earlier definition of the Property&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;private string _amitKumar=String.Empty;&lt;br /&gt;public string AmitKumar&lt;br /&gt;{&lt;br /&gt;          get {return _amitKumar;}&lt;br /&gt;          set {_amitKumar = value;}&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;Updated web part property definition,&lt;br /&gt;private string _amitKumar =String.Empty;&lt;br /&gt;public string AmitKumar&lt;br /&gt;{&lt;br /&gt;          get {return _amitKumar;}&lt;br /&gt;          set&lt;br /&gt;{&lt;br /&gt;   If(String.IsNullOrEmpty(value)&lt;br /&gt;    {&lt;br /&gt;          throw new Exception (“Value is required”);&lt;br /&gt;    }&lt;br /&gt;else&lt;br /&gt;   _amitKumar =value; &lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;  &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The above approach works perfectly fine and will not let you close the properties pane until you provide the value in the _amitKumar field, you will keep getting exception for that web part. Now the disadvantage here is the user does not get a friendly message telling him what exactly is going wrong, though we specify the message in the new Exception constructor, it still shows a generic message.&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution 2:&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;Now the above does fulfill the requirement but the client would clearly says they don’t like it because the error message does not talk about what happened and where, and hence there has to be a way to show the user our custom error message. So, we have used new exception of type WebPartPageUserException instead of Excepton. WebPartPageUserException class shows the exception custom message in the webpart property pane itself. So the correct or rather more appropriate way of implementing the above code would be,&lt;br /&gt; &lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;private string _amitKumar =String.Empty;&lt;br /&gt;public string AmitKumar&lt;br /&gt;{&lt;br /&gt;          get {return _amitKumar;}&lt;br /&gt;          set&lt;br /&gt;{&lt;br /&gt;   If(String.IsNullOrEmpty(value)&lt;br /&gt;    {&lt;br /&gt;          throw new WebPartPageUserException (“Value is required”);&lt;br /&gt;    }&lt;br /&gt;else&lt;br /&gt;   _amitKumar =value; &lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;And this will show the custom error message in the property pane so user knows what’s exactly is wrong.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-2250189006749128136?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/2250189006749128136/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=2250189006749128136" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/2250189006749128136?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/2250189006749128136?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/Khw5KLlvARw/sharepoint-web-parts-properties.html" title="SharePoint web parts properties validation" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/06/sharepoint-web-parts-properties.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEHSXgzeCp7ImA9WhZWEU0.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-53162801378592239</id><published>2011-05-11T14:05:00.006+05:30</published><updated>2011-05-11T14:17:18.680+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-11T14:17:18.680+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Master Page in SharePoint(MOSS)" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft Community Contributor Award 2011" /><category scheme="http://www.blogger.com/atom/ns#" term="Difference between an Relative and absolute URLs/Path" /><category scheme="http://www.blogger.com/atom/ns#" term="MOSS 2007" /><title>Amit Kumar awarded “Microsoft Community Contributor Award 2011”</title><content type="html">&lt;strong&gt;Amit Kumar awarded “Microsoft Community Contributor Award 2011”:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://social.msdn.microsoft.com/profile/amit.ak.kumar/" title='Amit Kumar' target='_blank'&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 339px; height: 134px;" src="http://4.bp.blogspot.com/-1FdY1JtXdl0/TcpKfEIHVWI/AAAAAAAAAgE/tzCq_sirtRA/s400/AmitKumar_MCC11.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5605374583760180578" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I’m very pleased and honored to share this with all of you that my community contributions have been recognized by Microsoft. I have received the Microsoft Community Contributor Award for year 2011. This is really great and I would like to thank Microsoft for honoring me with such an award!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://social.msdn.microsoft.com/profile/amit.ak.kumar/" title='Amit Kumar' target='_blank'&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 310px;" src="http://1.bp.blogspot.com/-YRBySmc3GUU/TcpKe-y1OqI/AAAAAAAAAf8/g-qMCxR22Z4/s400/AmitKumar_MCCAward.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5605374582328736418" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-53162801378592239?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/53162801378592239/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=53162801378592239" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/53162801378592239?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/53162801378592239?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/Czq6-fWIP-w/amit-kumar-awarded-microsoft-community.html" title="Amit Kumar awarded “Microsoft Community Contributor Award 2011”" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-1FdY1JtXdl0/TcpKfEIHVWI/AAAAAAAAAgE/tzCq_sirtRA/s72-c/AmitKumar_MCC11.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/05/amit-kumar-awarded-microsoft-community.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0IBSX48fSp7ImA9WhZSF08.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-3336483408643985665</id><published>2011-04-02T12:51:00.002+05:30</published><updated>2011-04-02T13:02:38.075+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-02T13:02:38.075+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Asp.Net FAQ" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="Difference between an Relative and absolute URLs/Path" /><category scheme="http://www.blogger.com/atom/ns#" term="MicroSoft.SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Effectively" /><category scheme="http://www.blogger.com/atom/ns#" term="System.Web.UI" /><category scheme="http://www.blogger.com/atom/ns#" term="Response.Redirect" /><category scheme="http://www.blogger.com/atom/ns#" term="MOSS 2007" /><title>How to convert absolute url to relative url</title><content type="html">&lt;b&gt;How to convert absolute url to relative url:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;URL:&lt;/b&gt; URL is just a fancy name for "address". You use a "url" to give the address to a link or image.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Absolute url:&lt;/b&gt; An url that is ABSOLUTE shows the complete address. In other words, there is no confusion about where this item is located, as the ABSOLUTE URL gives the entire path to that file. http://amitkumarmca04.blogspot.com/2011/02/get-list-data-using-sharepoint-object.html is an example of an ABSOLUTE url.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Relative url:&lt;/b&gt; A url that is RELATIVE only shows a partial address - like /2011/02/get-list-data-using-sharepoint-object.html - and the success or failure of finding the file is contingent on certain conditions being met - which means the outcome can and will vary, depending largely how the directories within your website are structured.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;After restoring the site from development environment to staging environment.&lt;br /&gt;If some document library having metadata like “ListURL”. This metadata contains url in the form of absolute url, then it will show development environment url into staging site. Now, application team decided to change this metadata value from absolute url to relative url, in that case we need to change value, which exist at present in the form of absolute url into relative url.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Resolution:&lt;/b&gt;&lt;br /&gt;In this scenario, we can use SharePoint Object Model classes to access data from custom SharePoint list and pass the value of “ListURL” to following function:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;public string GetRelativeURL(string urlToConvert)&lt;br /&gt;       {&lt;br /&gt;           char[] chrsplitter1 = { '/' };&lt;br /&gt;           string[] strsplitter1 = { "://" };&lt;br /&gt;           string convertedURL = string.Empty;&lt;br /&gt;           if (!string.IsNullOrEmpty(urlToConvert) &amp;amp;&amp;amp; !string.IsNullOrEmpty(urlToConvert))&lt;br /&gt;           {&lt;br /&gt;               //If url is not null&lt;br /&gt;               //Replace "https" with "http"&lt;br /&gt;               if (urlToConvert.ToLower().Contains("https"))&lt;br /&gt;               {&lt;br /&gt;                   urlToConvert = urlToConvert.Replace("https", "http");&lt;br /&gt;               }&lt;br /&gt;&lt;br /&gt;               //Remove "/" from start and end of the string&lt;br /&gt;               urlToConvert = urlToConvert.TrimStart(chrsplitter1).TrimEnd(chrsplitter1);&lt;br /&gt;&lt;br /&gt;               if (urlToConvert.ToLower().Contains("http"))&lt;br /&gt;               {&lt;br /&gt;                   // urlToConvert is a full URL, i.e. absolute URL&lt;br /&gt;                   // For Example : -- "http://amitkumarmca04.blogspot.com/2011/02/get-list-data-using-sharepoint-object.html" &lt;br /&gt;                   // So we are converting it into :-- /2011/02/get-list-data-using-sharepoint-object.html&lt;br /&gt;&lt;br /&gt;                   //Replace "\\" with "//"&lt;br /&gt;                   if (urlToConvert.ToLower().Contains("\\"))&lt;br /&gt;                   {&lt;br /&gt;                       urlToConvert = urlToConvert.Replace("\\", "//");&lt;br /&gt;                   }&lt;br /&gt;&lt;br /&gt;                   //Spilt url with "://"&lt;br /&gt;                   // For Example : -- "http://amitkumarmca04.blogspot.com/2011/02/get-list-data-using-sharepoint-object.html"&lt;br /&gt;                   string[] arrHTTP = urlToConvert.Split(strsplitter1, System.StringSplitOptions.RemoveEmptyEntries);&lt;br /&gt;                   //arrHTTP[0]="http"&lt;br /&gt;                   //arrHTTP[1]="amitkumarmca04.blogspot.com/2011/02/get-list-data-using-sharepoint-object.html"&lt;br /&gt;                   if (arrHTTP != null &amp;amp;&amp;amp; arrHTTP.Length &amp;gt;= 2)&lt;br /&gt;                   {&lt;br /&gt;                       if (!string.IsNullOrEmpty(arrHTTP[1]))&lt;br /&gt;                       {&lt;br /&gt;                           //If arrHTTP[1] is not null&lt;br /&gt;                           string relativeURL = string.Empty;&lt;br /&gt;                           if (arrHTTP[1].IndexOf("/") &amp;gt;= 0)&lt;br /&gt;                           {&lt;br /&gt;                               //If "/" found in the string&lt;br /&gt;                               relativeURL = arrHTTP[1].Substring(arrHTTP[1].IndexOf("/"));&lt;br /&gt;                           }&lt;br /&gt;                           else&lt;br /&gt;                           {&lt;br /&gt;                               //If "/" not found in the string&lt;br /&gt;                               relativeURL = arrHTTP[1];&lt;br /&gt;                           }&lt;br /&gt;&lt;br /&gt;                           if (!string.IsNullOrEmpty(relativeURL))&lt;br /&gt;                           {&lt;br /&gt;                               //We will receive relativeURL ="2011/02/get-list-data-using-sharepoint-object.html"&lt;br /&gt;                               relativeURL = relativeURL.TrimStart(chrsplitter1).TrimEnd(chrsplitter1);&lt;br /&gt;                               //We will receive convertedURL ="/2011/02/get-list-data-using-sharepoint-object.html"&lt;br /&gt;                               convertedURL = "/" + relativeURL;&lt;br /&gt;                           }&lt;br /&gt;                       }&lt;br /&gt;                   }&lt;br /&gt;&lt;br /&gt;               }&lt;br /&gt;               else&lt;br /&gt;               {&lt;br /&gt;                   //We will receive convertedURL ="/2011/02/get-list-data-using-sharepoint-object.html"&lt;br /&gt;                   convertedURL = "/" + urlToConvert;&lt;br /&gt;               }&lt;br /&gt;           }&lt;br /&gt;           else&lt;br /&gt;           {&lt;br /&gt;               //If url is null&lt;br /&gt;           }&lt;br /&gt;           return convertedURL;&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Above function return the relative url.&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href='http://gallery.menalto.com/node/30992' target='_blank'&gt;gallery.menalto.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-3336483408643985665?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/3336483408643985665/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=3336483408643985665" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3336483408643985665?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3336483408643985665?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/IoaNA89t0AI/how-to-convert-absolute-url-to-relative.html" title="How to convert absolute url to relative url" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/04/how-to-convert-absolute-url-to-relative.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4DQ3kyfSp7ImA9WhZTFU8.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-4102803744386261996</id><published>2011-03-19T14:07:00.010+05:30</published><updated>2011-03-19T14:59:32.795+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-19T14:59:32.795+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="StandardMenu" /><category scheme="http://www.blogger.com/atom/ns#" term="Office SharePoint Server" /><category scheme="http://www.blogger.com/atom/ns#" term="12 hives" /><category scheme="http://www.blogger.com/atom/ns#" term="form based authentication in sharepoint" /><category scheme="http://www.blogger.com/atom/ns#" term="membership" /><category scheme="http://www.blogger.com/atom/ns#" term="user registration" /><category scheme="http://www.blogger.com/atom/ns#" term="Extranet Password Reset" /><category scheme="http://www.blogger.com/atom/ns#" term="defaultprovider" /><title>Add password reset page in Form Based Authentication MOSS 2007 site</title><content type="html">&lt;b&gt;Add password reset page in Form Based Authentication MOSS 2007 site:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Overview:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This article explains how to add a reset password page in Form Based Authentication enable SharePoint 2007 (MOSS) site, so the user can reset  his/her password. We will add this page in standard menu.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;When you enable forms authentication on SharePoint 2007 (MOSS), it means that users credentials are stored in membership database like ASP.NET database. In Form Based Authentication site, if we want to reset password then reset password page should be accessible to anonymous user also.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We are going to add new feature (ResetPasswordPage  feature) in the standard user menu:&lt;br /&gt;&lt;br /&gt;1. Write code .cs file(c# file), In this class, we will inherit the class Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;public  class ExtranetPasswordReset_Test : Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2. Creating ExtranetPasswordReset_Test.aspx&lt;br /&gt;3. Creating ResetPasswordPage feature&lt;br /&gt;4. Deployment&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Creation of ExtranetPasswordReset_Test.aspx:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We will create new ExtranetPasswordReset.aspx with the help of VS 2005.&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;&lt;%@ Assembly Name="Microsoft.SharePoint,Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"  %&gt;&lt;br /&gt;&lt;%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase"  MasterPageFile="~/_layouts/simple.master"  %&gt;&lt;br /&gt;&lt;%@ Assembly Name="Test.Security, Version=3.0.0.0, Culture=neutral, PublicKeyToken=8b7a42e9b9b5355f" %&gt;&lt;br /&gt;&lt;%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"  Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;&lt;br /&gt;&lt;%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %&gt;&lt;br /&gt;&lt;%@ Import Namespace="Microsoft.SharePoint" %&gt;&lt;br /&gt;&lt;%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %&gt;&lt;br /&gt;&lt;script runat="server"&gt;protected override void OnLoad(EventArgs e) {    SPWeb site = this.Web;    lblSiteTitle.Text = site.Title;    lblSiteTitle.Text = site.ID.ToString().ToUpper();  }&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;asp:content id="Main" runat="server" contentplaceholderid="PlaceHolderMain"&gt;&lt;br /&gt;Site Title: &lt;asp:label id="lblSiteTitle" runat="server"&gt;&lt;br /&gt;&lt;/asp:label&gt;&lt;/asp:content&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Code behind file of ExtranetPasswordReset_Test.aspx, called ExtranetPasswordReset_Test.aspx.cs:&lt;br /&gt;&lt;br /&gt;1. We need add two functions:&lt;br /&gt;I. protected override bool AllowAnonymousAccess&lt;br /&gt;II. protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;b&gt;2.  Inherit the class with UnsecuredLayoutsPageBase class.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;namespace Test.Security.Web.UI&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public  class ExtranetPasswordReset_Test : Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase&lt;br /&gt;{&lt;br /&gt;protected override bool AllowAnonymousAccess&lt;br /&gt;{&lt;br /&gt;  get&lt;br /&gt;  {&lt;br /&gt;      return true;&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;  Response.Write("Test");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-Jxul5b4MqBQ/TYRrvx5r7xI/AAAAAAAAAfA/t-C-Tfn6eiY/s1600/Amit1.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 222px;" src="http://1.bp.blogspot.com/-Jxul5b4MqBQ/TYRrvx5r7xI/AAAAAAAAAfA/t-C-Tfn6eiY/s400/Amit1.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5585707906439573266" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Create ResetPasswordPage feature:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;We will create Feature file and put into the ResetPasswordPage folder inside the Feature folder.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/-0WF8JhHzLQM/TYRrvwxDtZI/AAAAAAAAAfI/URzNg31UNCE/s1600/AmitKumar2.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 181px;" src="http://1.bp.blogspot.com/-0WF8JhHzLQM/TYRrvwxDtZI/AAAAAAAAAfI/URzNg31UNCE/s400/AmitKumar2.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5585707906134947218" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We also need to create elements.xml file.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/-tOeZsCwTteo/TYRrwLYxO3I/AAAAAAAAAfQ/CbaR-JDaNDY/s1600/AmitKumar3.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 133px;" src="http://4.bp.blogspot.com/-tOeZsCwTteo/TYRrwLYxO3I/AAAAAAAAAfQ/CbaR-JDaNDY/s400/AmitKumar3.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5585707913280830322" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Set CustomAction properties as shown, Location to be ‘StandardMenu’ and UrlAction URL property should  be “_layouts/ExtranetPasswordReset_Test.aspx”&lt;br /&gt;3. Deployment&lt;br /&gt;1. Copy ‘ExtranetPasswordReset_Test.aspx’ file to the following path:&lt;br /&gt;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\&lt;br /&gt;2. Copy ResetPasswordPage folder that contains elements.xml and feature.xml to the following path: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;3. run the following command:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-OIoIae-1bxU/TYRrwWfCMzI/AAAAAAAAAfY/qefMVrtwv_0/s1600/AmitKumar4.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 115px;" src="http://2.bp.blogspot.com/-OIoIae-1bxU/TYRrwWfCMzI/AAAAAAAAAfY/qefMVrtwv_0/s400/AmitKumar4.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5585707916259898162" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now the feature is installed successfully, but needs to be activated.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;4. &lt;/b&gt;Go to your site-&gt; Site Actions -&gt; Site Settings -&gt; Modify All Site Settings-&gt;Site Collection Features -&gt;Activate ResetPasswordPage feature.&lt;br /&gt;&lt;br /&gt;Now you can find  Reset Password action in the standard user menu&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-ZQcCsoKr54o/TYRrwaSC_XI/AAAAAAAAAfg/FFCD5i06MsE/s1600/AmitKumar5.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 127px;" src="http://2.bp.blogspot.com/-ZQcCsoKr54o/TYRrwaSC_XI/AAAAAAAAAfg/FFCD5i06MsE/s400/AmitKumar5.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5585707917279165810" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-4102803744386261996?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/4102803744386261996/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=4102803744386261996" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4102803744386261996?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4102803744386261996?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/eS_wxJvValA/add-password-reset-page-in-form-based.html" title="Add password reset page in Form Based Authentication MOSS 2007 site" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-Jxul5b4MqBQ/TYRrvx5r7xI/AAAAAAAAAfA/t-C-Tfn6eiY/s72-c/Amit1.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/03/add-password-reset-page-in-form-based.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QBSXo-eCp7ImA9Wx9aFEo.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-6363762712158004567</id><published>2011-03-07T10:03:00.019+05:30</published><updated>2011-03-07T10:52:38.450+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-03-07T10:52:38.450+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft.Practices.EnterpriseLibrary" /><category scheme="http://www.blogger.com/atom/ns#" term="Command file" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="Batch file" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="MOSS2007" /><category scheme="http://www.blogger.com/atom/ns#" term="Global Assembly Cache Tool(Gacutil.exe)" /><category scheme="http://www.blogger.com/atom/ns#" term="deployment of SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="assembly" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar kashyap" /><title>How to deploy DLL’s into GAC using batch (.bat) file</title><content type="html">&lt;strong&gt;How to deploy DLL’s into GAC using batch (.bat) file: &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Global Assembly Cache Tool (Gacutil.exe): &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;The Global Assembly Cache tool allows you to view and manipulate the contents of the global assembly cache and download cache.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;gacutil [options] [assemblyName  assemblyPath  assemblyListFile]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The Gacutil is a tool used by developers to install versioned assemblies into the system Global Assembly Cache (GAC) to become part of the assemblies that are available for all applications at runtime.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Parameter: &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;assemblyName:&lt;/strong&gt;The name of an assembly. You can supply either a partially specified assembly name such as myAssembly or a fully specified assembly name such as myAssembly, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0038abc9deabfle5.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;assemblyPath:&lt;/strong&gt;The name of a file that contains an assembly manifest.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;assemblyListFile:&lt;/strong&gt;The path to an ANSI text file that lists assemblies to install or uninstall. To use a text file to install assemblies, specify the path to each assembly on a separate line in the file. The tool interprets relative paths, relative to the location of the assemblyListFile. To use a text file to uninstall assemblies, specify the fully qualified assembly name for each assembly on a separate line in the file. See the assemblyListFile contents examples later in this topic.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Option:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/cdl :&lt;/strong&gt;Deletes the contents of the download cache.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/f :&lt;/strong&gt;Specify this option with the /i or /il options to force an assembly to reinstall. If an assembly with the same name already exists in the global assembly cache, the tool overwrites it.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;/h[elp] :&lt;/strong&gt;Displays command syntax and options for the tool.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/i assemblyPath :&lt;/strong&gt;Installs an assembly into the global assembly cache.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/if&lt;/strong&gt; &lt;strong&gt;assemblyPath :&lt;/strong&gt;Installs an assembly into the global assembly cache. If an assembly with the same name already exists in the global assembly cache, the tool overwrites it.&lt;br /&gt;Specifying this option is equivalent to specifying the /i and /f options together.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/il assemblyListFile :&lt;/strong&gt;Installs one or more assemblies specified in assemblyListFile into the global assembly cache.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/ir assemblyPath :&lt;/strong&gt;Installs an assembly into the global assembly cache and adds a reference to count the assembly. You must specify the assemblyPath, scheme, id, and description parameters with this option. For a description of the valid values you can specify for these parameters, see the /r option. Specifying this option is equivalent to specifying the /i and /r options together.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;/l [assemblyName] :&lt;/strong&gt;Lists the contents of the global assembly cache. If you specify the assemblyName parameter, the tool lists only the assemblies matching that name.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/ldl :&lt;/strong&gt;Lists the contents of the downloaded files cache.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/lr [assemblyName] :&lt;/strong&gt;Lists all assemblies and their corresponding reference counts. If you specify the assemblyName parameter, the tool lists only the assemblies matching that name and their corresponding reference counts.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/nologo :&lt;/strong&gt;Suppresses the Microsoft startup banner display.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/r [assemblyName assemblyPath] :&lt;/strong&gt;Specifies a traced reference to an assembly or assemblies to install or uninstall. Specify this option with the /i, /il, /u, or /ul options.&lt;br /&gt;To install an assembly, specify the assemblyPath, scheme, id, and description parameters with this option. To uninstall an assembly, specify the assemblyName, scheme, id, and description parameters.&lt;br /&gt;To remove a reference to an assembly, you must specify the same scheme, id, and description parameters that were specified with the /i and /r (or /ir) options when the assembly was installed. If you are uninstalling an assembly, the tool also removes the assembly from the global assembly cache if it is the last reference to remove and if Windows Installer has no outstanding references to the assembly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/silent :&lt;/strong&gt;Suppresses the display of all output.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/u assemblyName :&lt;/strong&gt;Uninstalls an assembly from the global assembly cache.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;/uf assemblyName :&lt;/strong&gt;Forces a specified assembly to uninstall by removing all references to the assembly. Specifying this option is equivalent to specifying the /u and /f options together.&lt;br /&gt;Note :You cannot use this option to remove an assembly that was installed using Microsoft Windows Installer. If you attempt this operation, the tool displays an error message.&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;/ul assemblyListFile :&lt;/strong&gt;Uninstalls one or more assemblies specified in assemblyListFile from the global assembly cache.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/u[ngen] assemblyName :&lt;/strong&gt;Uninstalls a specified assembly from the global assembly cache. If the specified assembly has existing reference counts, the tool displays the reference counts and does not remove the assembly from the global assembly cache.&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; In the .NET Framework version 2.0, /ungen is not supported. Instead, use the uninstall command of the Native Image Generator (Ngen.exe).&lt;br /&gt;In the .NET Framework versions 1.0 and 1.1, specifying /ungen causes Gacutil.exe to remove the assembly from the native image cache. This cache stores the native images for assemblies that have been created using the Native Image Generator (Ngen.exe).&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;/ur assemblyName :&lt;/strong&gt;Uninstalls a reference to a specified assembly from the global assembly cache. To remove a reference to an assembly, you must specify the same scheme, id, and description parameters that were specified with the /i and /r (or /ir) options when the assembly was installed. For a description of the valid values you can specify for these parameters, see the /r option. Specifying this option is equivalent to specifying the /u and /r options together.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;/? :&lt;/strong&gt;Displays command syntax and options for the tool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Problem:&lt;/strong&gt; How to deploy DLL’s into GAC using batch (.bat) file&lt;br /&gt;&lt;strong&gt;Resolution:&lt;/strong&gt;&lt;br /&gt;There are 2 ways to deploy DLL’s into GAC using batch (.bat) file:&lt;br /&gt;&lt;strong&gt;1. Using ul &amp;amp; il option of Gacutil.exe in batch file:&lt;br /&gt;&lt;/strong&gt;For example, we need to un-install some Microsoft.Practices.EnterpriseLibrary.Common,Version=3.1.0.0 dll from GAC and need to install some Microsoft.Practices.EnterpriseLibrary.Common,Version= 5.0.414.0 into GAC. For this I created a text files which contain the details of DLL’s which we need to un-install and install:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;i. UnInstallAssemblyList.txt:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Common,Version=3.1.0.0,Culture=Neutral,PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Data,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Security.Cryptography,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ii. InstallAssemblyList.txt:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Common,Version=5.0.414.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Data,Version=5.0.414.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,Version=5.0.414.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging,Version=5.0.414.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Logging,Version=5.0.414.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;Microsoft.Practices.EnterpriseLibrary.Security.Cryptography,Version=5.0.414.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;iii. InstallMicrosoftEnterpriseLibrary.bat: &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;@echo off&lt;br /&gt;setlocal&lt;br /&gt;Echo Un-Installing dll from GAC&lt;br /&gt;%GACUTIL% /ul UnInstallAssemblyList.txt&lt;br /&gt;Echo Installing dll in GAC&lt;br /&gt;%GACUTIL% /il InstallAssemblyList.txt&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For running InstallMicrosoftEnterpriseLibrary.bat:&lt;br /&gt;Set the environment variables for&lt;br /&gt;1. GACUTIL&lt;br /&gt;Navigate to folder where InstallMicrosoftEnterpriseLibrary.bat stored and execute the following scripts:&lt;br /&gt;&lt;br /&gt;1. InstallMicrosoftEnterpriseLibrary.bat&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Using uf &amp;amp; i option of Gacutil.exe in batch file:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;For example, we need to un-install some Microsoft.Practices.EnterpriseLibrary.Common,Version=3.1.0.0 dll from GAC and need to install some Microsoft.Practices.EnterpriseLibrary.Common,Version= 5.0.414.0 into GAC. For this I created a batch file called InstallMicrosoftEnterpriseLibrary.bat:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;@echo off&lt;br /&gt;setlocal&lt;br /&gt;Echo Un-Installing dll from GAC&lt;br /&gt;%GACUTIL% /uf "Microsoft.Practices.EnterpriseLibrary.Common,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br /&gt;%GACUTIL% /uf "Microsoft.Practices.EnterpriseLibrary.Data,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br /&gt;%GACUTIL% /uf "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br /&gt;%GACUTIL% /uf "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br /&gt;%GACUTIL% /uf "Microsoft.Practices.EnterpriseLibrary.Logging,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br /&gt;%GACUTIL% /uf "Microsoft.Practices.EnterpriseLibrary.Security.Cryptography,Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;br /&gt;&lt;br /&gt;Echo Installing dll in GAC&lt;br /&gt;%GACUTIL% /i "Microsoft.Practices.EnterpriseLibrary.Common.dll"&lt;br /&gt;%GACUTIL% /i "Microsoft.Practices.EnterpriseLibrary.Data.dll"&lt;br /&gt;%GACUTIL% /i "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll"&lt;br /&gt;%GACUTIL% /i "Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll"&lt;br /&gt;%GACUTIL% /i "Microsoft.Practices.EnterpriseLibrary.Logging.dll"&lt;br /&gt;%GACUTIL% /i "Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For running InstallMicrosoftEnterpriseLibrary.bat:&lt;br /&gt;Set the environment variables for&lt;br /&gt;1. GACUTIL&lt;br /&gt;Navigate to folder where InstallMicrosoftEnterpriseLibrary.bat stored and execute the following scripts:&lt;br /&gt;1. InstallMicrosoftEnterpriseLibrary.bat&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="http://msdn.microsoft.com/en-us/library/ex0ss12c(v=VS.80).aspx" target="_blank"&gt;MSDN&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-6363762712158004567?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/6363762712158004567/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=6363762712158004567" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/6363762712158004567?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/6363762712158004567?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/z0-RJV6SEWk/how-to-deploy-dlls-into-gac-using-batch.html" title="How to deploy DLL’s into GAC using batch (.bat) file" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/03/how-to-deploy-dlls-into-gac-using-batch.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A04CSH45eip7ImA9Wx9bE0k.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-5228976175744037938</id><published>2011-02-22T10:08:00.005+05:30</published><updated>2011-02-22T10:16:09.022+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-22T10:16:09.022+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Inheritance" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="Role Definitions" /><category scheme="http://www.blogger.com/atom/ns#" term="Role Assignments" /><category scheme="http://www.blogger.com/atom/ns#" term="Custom role" /><category scheme="http://www.blogger.com/atom/ns#" term="default role" /><category scheme="http://www.blogger.com/atom/ns#" term="Microsoft SharePoint (MOSS 2007)" /><category scheme="http://www.blogger.com/atom/ns#" term="integrated role" /><category scheme="http://www.blogger.com/atom/ns#" term="Membership Provider" /><title>Default/Integrated role in SharePoint 2007</title><content type="html">&lt;strong&gt;Default/Integrated role in SharePoint 2007: &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;A role consists of two parts:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; Role definition&lt;br /&gt;&lt;strong&gt;2.&lt;/strong&gt; Role assignment.&lt;br /&gt;&lt;br /&gt;The &lt;strong&gt;role definition&lt;/strong&gt;, or permission level, is the list of rights associated with the role. A right is a uniquely controllable action within a SharePoint Web site. For example, a user with the Read role can browse pages in the Web site and view items in lists. Unlike in Windows SharePoint Services 2.0, in Windows SharePoint Services 3.0 user permissions are never managed directly using rights. All user and group permissions are managed through roles. A role definition is a collection of rights bound to a specific object. Role definitions are scoped to the Web site (for example, Full Control, Read, Contribute, Design, or Limited Access) and mean the same thing everywhere within the Web site, but their meanings can differ between sites within the same site collection. Role definitions can also be inherited from the parent Web site, just as permissions.&lt;br /&gt;&lt;br /&gt;The &lt;strong&gt;role assignment&lt;/strong&gt; is the relationship among the role definition, the users and groups, and the scope (for example, one user may be a reader on list one, while another user is a reader on list two). The relationship expressed through the role assignment is the key to making Windows SharePoint Services security management role-based. All permissions are managed through roles; you never assign rights directly to a user, but only meaningful collections of rights (role definitions) that are well defined and consistent. You manage unique permissions by adding or removing users and groups to or from role definitions through role assignments.&lt;br /&gt;&lt;br /&gt;The default/integrated role in SharePoint 2007:&lt;br /&gt;&lt;strong&gt;1. Full Control&lt;br /&gt;2. Read&lt;br /&gt;3. Contribute&lt;br /&gt;4. Design&lt;br /&gt;5. Limited Access &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reference:&lt;/strong&gt; &lt;a href="http://msdn.microsoft.com/en-us/library/ms414036(v=office.12).aspx" target="_blank" alt="Amit Kumar"&gt;MSDN&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-5228976175744037938?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/5228976175744037938/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=5228976175744037938" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/5228976175744037938?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/5228976175744037938?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/cepB0fVjcYc/defaultintegrated-role-in-sharepoint.html" title="Default/Integrated role in SharePoint 2007" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/02/defaultintegrated-role-in-sharepoint.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQNR3s9fip7ImA9WhZWEU0.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-1596039703713344806</id><published>2011-02-15T14:51:00.006+05:30</published><updated>2011-05-11T14:13:16.566+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-11T14:13:16.566+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="RSA" /><category scheme="http://www.blogger.com/atom/ns#" term="Content Editor Web Part in SharePoint(MOSS)" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Object Model" /><category scheme="http://www.blogger.com/atom/ns#" term="XSL Styles Sheets" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Data Protection API" /><category scheme="http://www.blogger.com/atom/ns#" term="MOSS" /><category scheme="http://www.blogger.com/atom/ns#" term="Encrypting Web.Config" /><category scheme="http://www.blogger.com/atom/ns#" term="DPAPI" /><title>Encrypting Web.Config</title><content type="html">&lt;strong&gt;Encrypting Web.Config using RSAProtectedConfigurationProvider in SharePoint&lt;br /&gt;&lt;br /&gt;Overview:&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;One of the most common uses of the protected configuration is to encrypt connection strings in web.confg (that's one of the reasons for creating a separate tag for connection strings instead of adding it in appSettings tag). Adding this connection string as plain text is not the best practice for sharepoint web application security and this might cause serious hacking problems. Sharepoint also support for encrypting and decrypting configuration sections in web.config file. In this article, we will explore how to encrypt and decrypt sections of the web.config. We can encrypt the configuration sections by using two built-in providers: DPAPI (Windows Data Protection API) Provider or the RSA provider. The RSA provider (default) uses an RSA key which holds public and private keys, where as the DPAPI provider uses built-in machine-specific key. Let us explore the steps required to encrypt the sections using RSA.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Below are steps in detail:&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Add a web.config file to the project. Right click the project &gt; Add New Item &gt; Web Configuration File&lt;br /&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; To create the custom configuration section in Web.Config file please create the custom class inherited from ConfigurationSection class.&lt;br /&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Web.Configuration;&lt;br /&gt;&lt;br /&gt;namespace AmitKumar.GeneralSite.Web.UI&lt;br /&gt;{&lt;br /&gt;    class CustomUpdateProfileSection : ConfigurationSection&lt;br /&gt;    {&lt;br /&gt;        private static CustomUpdateProfileSection settings = ConfigurationManager.GetSection("CustomUpdateProfileSection") as CustomUpdateProfileSection;&lt;br /&gt;        public static CustomUpdateProfileSection Settings&lt;br /&gt;        {&lt;br /&gt;            get&lt;br /&gt;            {&lt;br /&gt;                return settings;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        [ConfigurationProperty("UpdateProfileUserDomain", DefaultValue = "v4", IsRequired = true)]&lt;br /&gt;        public string UpdateProfileUserDomain&lt;br /&gt;        {&lt;br /&gt;            get { return (string)this["UpdateProfileUserDomain"]; }&lt;br /&gt;            set { this["UpdateProfileUserDomain"] = value; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        [ConfigurationProperty("UpdateProfileUserName", IsRequired = true)]&lt;br /&gt;        public string UpdateProfileUserName&lt;br /&gt;        {&lt;br /&gt;            get { return (string)this["UpdateProfileUserName"]; }&lt;br /&gt;            set { this["UpdateProfileUserName"] = value; }&lt;br /&gt;        }&lt;br /&gt;        [ConfigurationProperty("UpdateProfileUserPassword", IsRequired = true)]&lt;br /&gt;        public string UpdateProfileUserPassword&lt;br /&gt;        {&lt;br /&gt;            get { return (string)this["UpdateProfileUserPassword"]; }&lt;br /&gt;            set { this["UpdateProfileUserPassword"] = value; }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Sign the assembly with the strong name and deploy in the GAC.&lt;br /&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Define the custom section in the Web.Config file&lt;br /&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;  &lt;configsections&gt;&lt;br /&gt;    &lt;section name="CustomUpdateProfileSection" type="AmitKumar.Web.UI.CustomUpdateProfileSection, AmitKumar, Version=3.0.0.0, Culture=neutral, PublicKeyToken=8b7a42e9b9amitf"&gt;&lt;br /&gt;  &lt;/configsections&gt;&lt;br /&gt;  &lt;customupdateprofilesection updateprofileuserdomain="v4" updateprofileusername="amit" updateprofileuserpassword="pass"&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; "AmitKumar.Web.UI.CustomUpdateProfileSection" is the name of the class. "AmitKumar" is the name of the Assembly.&lt;br /&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Now add two buttons to the page, called btnEncrypt and btnDecrypt. We will use these buttons to encrypt and decrypt the sections of the web.config file. Add the following code in the button click event of the two buttons:&lt;br /&gt;&lt;br /&gt;&lt;pre class="CSharp" name="code"&gt;&lt;br /&gt;public void btnEncrypt_OnClick(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    try&lt;br /&gt;    {&lt;br /&gt;        System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);&lt;br /&gt;        ConfigurationSection objSection = config.GetSection("CustomUpdateProfileSection");&lt;br /&gt;        if ((config != null) &amp;amp;&amp;amp; (!objSection.SectionInformation.IsProtected))&lt;br /&gt;        {&lt;br /&gt;            if (!objSection.ElementInformation.IsLocked)&lt;br /&gt;            {&lt;br /&gt;                objSection.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");&lt;br /&gt;                config.Save();&lt;br /&gt;                this.lblCustomError.Visible = false;&lt;br /&gt;                this.lblSuccess.Text = "Successfully Encrypted, Kindly check the Web.Config file.";&lt;br /&gt;                this.lblSuccess.Visible = true;&lt;br /&gt;            }                &lt;br /&gt;        }         &lt;br /&gt;             &lt;br /&gt;    }&lt;br /&gt;    catch (Exception ex)&lt;br /&gt;    {&lt;br /&gt;        string strErrorMsg = "Error, DateTime :" + DateTime.Now.ToLongTimeString() + ", Error : " + ex.Message.ToString() + ", Stack Trace : " + ex.StackTrace.ToString();&lt;br /&gt;        this.lblCustomError.Text = strErrorMsg;&lt;br /&gt;        this.lblCustomError.Visible = true;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void btnDecrypt_OnClick(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    try&lt;br /&gt;    {&lt;br /&gt;        System.Configuration.Configuration objConfig = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);&lt;br /&gt;        ConfigurationSection objSection = objConfig.GetSection("CustomUpdateProfileSection");&lt;br /&gt;        if (objConfig != null &amp;amp;&amp;amp; objSection.SectionInformation.IsProtected)&lt;br /&gt;        {&lt;br /&gt;            if (!objSection.ElementInformation.IsLocked)&lt;br /&gt;            {&lt;br /&gt;                objSection.SectionInformation.UnprotectSection();&lt;br /&gt;                objConfig.Save();&lt;br /&gt;                this.lblCustomError.Visible = false;&lt;br /&gt;                this.lblSuccess.Text = "Successfully Decrypted, Kindly check the Web.Config file.";&lt;br /&gt;                this.lblSuccess.Visible = true;&lt;br /&gt;            }                 &lt;br /&gt;        }              &lt;br /&gt;             &lt;br /&gt;    }&lt;br /&gt;    catch (Exception ex)&lt;br /&gt;    {&lt;br /&gt;        string strErrorMsg = "Error, DateTime :" + DateTime.Now.ToLongTimeString() + ", Error : " + ex.Message.ToString() + ", Stack Trace : " + ex.StackTrace.ToString();&lt;br /&gt;        this.lblCustomError.Text = strErrorMsg;&lt;br /&gt;        this.lblCustomError.Visible = true;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-1596039703713344806?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/1596039703713344806/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=1596039703713344806" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/1596039703713344806?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/1596039703713344806?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/oNRzsHTHGm0/encrypting-webconfig.html" title="Encrypting Web.Config" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/02/encrypting-webconfig.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EASX8zeSp7ImA9Wx9UFUU.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-4705144070713821437</id><published>2011-02-13T14:55:00.005+05:30</published><updated>2011-02-13T15:04:08.181+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-13T15:04:08.181+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="System.Data" /><category scheme="http://www.blogger.com/atom/ns#" term="SPList objects" /><category scheme="http://www.blogger.com/atom/ns#" term="Export Import SharePoint List" /><category scheme="http://www.blogger.com/atom/ns#" term="using SharePoint Object Model" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010 client object model" /><title>Get list data using SharePoint Object Model</title><content type="html">&lt;b&gt;Get list data using SharePoint Object Model:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This article explains how you can use the SharePoint Object Model(MOSS 2007)  classes like SPSite and  SPWeb in C# or Visual Basic code to fetch data from a custom SharePoint list.&lt;br /&gt;&lt;br /&gt;This article explains how you can use the SharePoint Object Model(MOSS 2007)  classes like SPSite and  SPWeb in C# or Visual Basic code to fetch data from a custom SharePoint list.&lt;div&gt;&lt;br /&gt;&lt;b&gt;Problem:&lt;/b&gt;&lt;br /&gt;You want to get data on the basis of url (including siteurl+listname) from the custom SharePoint list.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;Resolution:&lt;/b&gt;&lt;br /&gt;In this scenario, we can use SharePoint Object Model classes to access data from custom SharePoint list.&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;public static bool CheckListExists(string listName, SPWeb web,ref SPList list)&lt;br /&gt;     {&lt;br /&gt;         try&lt;br /&gt;         {&lt;br /&gt;             //---Check list exist or not&lt;br /&gt;             if (web.Lists[listName]!=null)&lt;br /&gt;             {&lt;br /&gt;                 list = web.Lists[listName];&lt;br /&gt;                 return true;&lt;br /&gt;             }&lt;br /&gt;             return false;&lt;br /&gt;         }&lt;br /&gt;         catch (ArgumentException ex)&lt;br /&gt;         {&lt;br /&gt;             return false;&lt;br /&gt;         }&lt;br /&gt;         catch (Exception ex)&lt;br /&gt;         {&lt;br /&gt;             return false;&lt;br /&gt;&lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Above function used to check list exist in the SharePoint site or not.&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;     public static void  GetListData(string listUrl)&lt;br /&gt;     {&lt;br /&gt;         SPList objList = null;&lt;br /&gt;         char [] chrSplitter={'/'};&lt;br /&gt;         try&lt;br /&gt;         {&lt;br /&gt;             listUrl = listUrl.TrimEnd(chrSplitter);&lt;br /&gt;             string[] arrList = listUrl.Split(chrSplitter);&lt;br /&gt;             if (arrList != null &amp;amp;&amp;amp; arrList.Length &gt; 0)&lt;br /&gt;             {&lt;br /&gt;&lt;br /&gt;                 using (SPSite site = new SPSite(listUrl))&lt;br /&gt;                 {&lt;br /&gt;                     using (SPWeb web = site.OpenWeb())&lt;br /&gt;                     {&lt;br /&gt;                         if(CheckListExists(SPEncode.UrlDecodeAsUrl(arrList[arrList.Length - 1]),web,ref objList))&lt;br /&gt;                         {&lt;br /&gt;                            //Add business logic here&lt;br /&gt;                         }&lt;br /&gt;                     }&lt;br /&gt;                 }&lt;br /&gt;             }&lt;br /&gt;          &lt;br /&gt;&lt;br /&gt;         }&lt;br /&gt;         catch (Exception ex)&lt;br /&gt;         {&lt;br /&gt;&lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Above function used to get data from SharePoint site by passing the url only. The url contain both site url and list name. For example:&lt;br /&gt;&lt;br /&gt;From presentation layer, we make a call to GetListData function&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;string listUrl="http://amitkumarmca04.blogspot.com/sites/mcapassion/Lists/AmitKumar";&lt;br /&gt;GetListData(listUrl);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-4705144070713821437?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/4705144070713821437/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=4705144070713821437" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4705144070713821437?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/4705144070713821437?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/QoLTPp-jVZE/get-list-data-using-sharepoint-object.html" title="Get list data using SharePoint Object Model" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/02/get-list-data-using-sharepoint-object.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYCQHgyeSp7ImA9Wx9XGU0.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-3604831908665183639</id><published>2011-01-13T12:09:00.010+05:30</published><updated>2011-01-13T12:49:21.691+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-13T12:49:21.691+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Summary Link Web Part" /><category scheme="http://www.blogger.com/atom/ns#" term="Item Styles" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="add new styles" /><category scheme="http://www.blogger.com/atom/ns#" term="XSL Styles Sheets" /><category scheme="http://www.blogger.com/atom/ns#" term="How to Customize     Styles" /><category scheme="http://www.blogger.com/atom/ns#" term="ItemStyle.xsl" /><category scheme="http://www.blogger.com/atom/ns#" term="Customizing Styles" /><category scheme="http://www.blogger.com/atom/ns#" term="Header.xsl" /><category scheme="http://www.blogger.com/atom/ns#" term="Content By     Query" /><category scheme="http://www.blogger.com/atom/ns#" term="MOSS 2007" /><title>Customizing Styles of Summary Links Web Parts</title><content type="html">Customizing Styles of Summary Links Web Parts:&lt;br /&gt;&lt;br /&gt;The Summary Link field control present authored links on your page. You can base these links on a set of styles available to the Web site.&lt;br /&gt;You can also style the items and group headers in these Web Parts so they use a set of available styles to render.&lt;br /&gt;Microsoft Office SharePoint Server 2007 uses XSL style sheets to present these Web Parts. You can customize and extend styles to match the color and branding of your Web site.&lt;br /&gt;The following table shows the mapping of XSL style sheet files and the corresponding Web Parts.&lt;br /&gt;&lt;br /&gt;&lt;table class="MsoNormalTable" border="1" cellspacing="0" cellpadding="0" width="100%" style="width:100.0%;border-collapse:collapse;border:none;mso-border-alt:solid #BBBBBB .75pt;  mso-yfti-tbllook:1184"&gt;  &lt;tbody&gt;&lt;tr style="mso-yfti-irow:0;mso-yfti-firstrow:yes;height:15.75pt"&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;mso-border-alt:solid #BBBBBB .75pt;   background:#FFC000;padding:3.0pt 3.0pt 3.0pt 3.0pt;height:15.75pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:   normal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.5pt;   font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;XSL   Style Sheet &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-left:none;mso-border-left-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:#FFC000;   padding:3.0pt 3.0pt 3.0pt 3.0pt;height:15.75pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:   normal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.5pt;   font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Purpose   &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-left:none;mso-border-left-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:#FFC000;   padding:3.0pt 3.0pt 3.0pt 3.0pt;height:15.75pt"&gt;   &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height:   normal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.5pt;   font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Corresponding   Web Part &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="mso-yfti-irow:1"&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-top:none;mso-border-top-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:white;   padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;ContentQueryMain.xsl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;"Application" XSL style sheet&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Content Query&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="mso-yfti-irow:2"&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-top:none;mso-border-top-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:white;   padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Header.xsl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Group headers for Content Query and Summary   Links, title headers for Table of Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Content Query, Summary Links, Table of   Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="mso-yfti-irow:3"&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-top:none;mso-border-top-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:white;   padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;ItemStyle.xsl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Content Query and Summary Link item styles&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Content Query, Summary Links&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="mso-yfti-irow:4"&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-top:none;mso-border-top-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:white;   padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;LevelStyle.xsl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Table of Contents level styles, which includes   the site and its pages&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Table of Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="mso-yfti-irow:5"&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-top:none;mso-border-top-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:white;   padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;SummaryLinkMain.xsl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;"Application" XSL for Summary Links&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Summary Links&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="mso-yfti-irow:6;mso-yfti-lastrow:yes"&gt;   &lt;td valign="top" style="border:solid #BBBBBB 1.0pt;border-top:none;mso-border-top-alt:   solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;background:white;   padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;TableOfContentsMain.xsl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;"Application" XSL for Table of   Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td valign="top" style="border-top:none;border-left:none;border-bottom:solid #BBBBBB 1.0pt;   border-right:solid #BBBBBB 1.0pt;mso-border-top-alt:solid #BBBBBB .75pt;   mso-border-left-alt:solid #BBBBBB .75pt;mso-border-alt:solid #BBBBBB .75pt;   background:white;padding:3.0pt 3.0pt 3.0pt 3.0pt"&gt;   &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;margin-right:.75pt;   mso-margin-bottom-alt:auto;margin-left:.75pt;line-height:140%"&gt;&lt;span style="font-size:9.5pt;line-height:140%;font-family:Arial;mso-fareast-font-family:   &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Table of Contents&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-outline-level:1"&gt;&lt;b&gt;&lt;span style="font-size:17.0pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;mso-font-kerning:18.0pt"&gt;Requirement: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-outline-level:1"&gt;&lt;b&gt;&lt;span style="font-size:17.0pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;mso-font-kerning:18.0pt"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family: Arial"&gt;We required two custom styles for link items:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt;line-height: 115%;font-family:Arial;mso-fareast-font-family:Arial"&gt;&lt;span style="mso-list: Ignore"&gt;1.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:10.0pt;line-height: 115%;font-family:Arial"&gt;First style with one horizontal line.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1"&gt;&lt;!--[if !supportLists]--&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt;line-height: 115%;font-family:Arial;mso-fareast-font-family:Arial"&gt;&lt;span style="mso-list: Ignore"&gt;2.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:10.0pt;line-height: 115%;font-family:Arial"&gt;Second style with two horizontal lines&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-outline-level:1"&gt;&lt;b&gt;&lt;span style="font-size:17.0pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;mso-font-kerning:18.0pt"&gt;Steps to update:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-outline-level:1"&gt;&lt;b&gt;&lt;span style="font-size:17.0pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;mso-font-kerning:18.0pt"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;b&gt;&lt;span style="font-size:10.5pt;line-height:115%;font-family:Arial;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-ansi-language:EN-US;mso-fareast-language:EN-US; mso-bidi-language:AR-SA"&gt;1. First we will create css class:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;.SingleLine&lt;br /&gt;{&lt;br /&gt;Border-bottom:1px solid #000000; text-decoration:none;&lt;br /&gt;FONT-FAMILY: Arial, Helvetica; font-size:12px;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;.SingleLine A, .SingleLine A:link, .SingleLine A:active,.SingleLine A:visited&lt;br /&gt;{&lt;br /&gt;text-decoration:none;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Add above mentioned css class into your site css file.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.25in;text-indent:-.25in;line-height:normal;mso-outline-level:3; mso-list:l1 level1 lfo1;tab-stops:list .25in"&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span style="font-size:10.5pt;font-family:Arial;mso-fareast-font-family:Arial"&gt;&lt;span style="mso-list:Ignore"&gt;2.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="font-size:10.5pt;font-family: Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;"&gt;To find and modify Summary Link styles&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;1.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Navigate to the home page of your Web site and click &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:9.5pt; mso-bidi-font-size:11.0pt;font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:black"&gt;View All Site Content&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:9.5pt; font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;2.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Click &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:9.5pt;mso-bidi-font-size:11.0pt;font-family:Arial;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black"&gt;Style Library&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9.5pt;font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;3.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Click &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:9.5pt;mso-bidi-font-size:11.0pt;font-family:Arial;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black"&gt;XSL Styles Sheets&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:black"&gt;. The list of XSL files available in the Style Library for all three Web Part types appears.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;4.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;To see an example, open ItemStyle.xsl, which controls the display of Summary Link items, to modify it. Next, consider the file's structure and contents.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:1.0in;text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;a.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;The XSL template is simply HTML with a few variables (&lt;/span&gt;&lt;b&gt;&lt;span style="font-size:9.5pt; mso-bidi-font-size:11.0pt;font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:black"&gt;@ImageURL&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;, &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:9.5pt;mso-bidi-font-size:11.0pt;font-family:Arial;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black"&gt;@LinkURL&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size:9.5pt; font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;, &lt;/span&gt;&lt;b&gt;&lt;span style="font-size:9.5pt;mso-bidi-font-size:11.0pt;font-family:Arial;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;color:black"&gt;@Description&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9.5pt;font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;, and so on). &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:1.0in;text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;b.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;You can show or hide the Summary Link data by adding or removing these variables.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:1.0in;text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;c.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;You can also choose to change how the surrounding HTML makes these variables appear.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:1.0in;text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;d.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Each XSL template maps to one style that an author can choose.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:1.0in;text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;e.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;The first section of the code sample includes XSL templates that Office SharePoint Server 2007 calls, passes data to, and gets modified versions of the data from.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:1.0in;text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo2"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:Arial; color:black"&gt;&lt;span style="mso-list:Ignore"&gt;f.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;The section includes the rendered HTML with the result of the functions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:1.0in;text-indent:-.25in;line-height:normal;mso-list:l0 level2 lfo2"&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;xsl:template name="Default" match="*" mode="itemstyle"&gt;&lt;br /&gt;// This section includes a set of functions, or xsl templates, which MOSS 2007 calls, passes data into, and gets modified versions of the data from.  The product does this primarily to improve security.&lt;br /&gt;&lt;xsl:variable name="SafeLinkUrl"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetSafeLink"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="SafeImageUrl"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetSafeStaticUrl"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'ImageUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="DisplayTitle"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetTitle"&gt;&lt;br /&gt;&lt;xsl:with-param name="Title" select="@Title"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="LinkTarget"&gt;&lt;br /&gt;&lt;xsl:if test="@OpenInNewWindow = 'True'"&gt;_blank&lt;/xsl:if&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;// Includes the rendered HTML with the results of the functions.&lt;br /&gt;&lt;div id="linkitem" class="item"&gt;&lt;br /&gt;&lt;xsl:if test="string-length($SafeImageUrl) != 0"&gt;&lt;br /&gt;&lt;div class="image-area-left"&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/%7B$SafeLinkUrl%7D" target="{$LinkTarget}"&gt;&lt;br /&gt;    &lt;img class="image" src="http://www.blogger.com/%7B$SafeImageUrl%7D" alt="{@ImageUrlAltText}" /&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/xsl:if&gt;&lt;br /&gt;&lt;div class="link-item"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/%7B$SafeLinkUrl%7D" target="{$LinkTarget}" title="{@LinkToolTip}"&gt;&lt;br /&gt;&lt;xsl:value-of select="$DisplayTitle"&gt;&lt;br /&gt;&lt;/xsl:value-of&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class="description"&gt;&lt;br /&gt;&lt;xsl:value-of select="@Description"&gt;&lt;br /&gt;&lt;/xsl:value-of&gt;&lt;/div&gt;&lt;br /&gt;&lt;/xsl:call-template&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.25in;text-indent:-.25in;line-height:normal;mso-outline-level:3; mso-list:l1 level1 lfo1;tab-stops:list .25in"&gt;&lt;!--[if !supportLists]--&gt;&lt;b&gt;&lt;span style="font-size:10.5pt;font-family:Arial;mso-fareast-font-family:Arial"&gt;&lt;span style="mso-list:Ignore"&gt;3.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="font-size:10.5pt;font-family: Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;"&gt;To create a new style:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo2; tab-stops:list .5in"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt; font-family:Arial;mso-fareast-font-family:Arial;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;1.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Repeat steps 1 through 4 mentioned in &lt;b style="mso-bidi-font-weight:normal"&gt;step 2&lt;/b&gt; in the previous procedure to navigate to the ItemStyle.xsl file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo2; tab-stops:list .5in"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt; font-family:Arial;mso-fareast-font-family:Arial;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;2.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Open the ItemStyle.xsl file and add the following code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;line-height:normal"&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:black"&gt;//&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt;font-family:Verdana;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;"&gt; SingleLine style&lt;/span&gt;&lt;/b&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:9.5pt;font-family:Arial;mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;; color:black"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;xsl:template name="SingleLine" match="Row[@Style='SingleLine']" mode="itemstyle"&gt;&lt;br /&gt;&lt;xsl:param name="GroupPosition"&gt;&lt;br /&gt;&lt;xsl:variable name="SafeLinkUrl"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetSafeLink"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="SafeImageUrl"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetSafeStaticUrl"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'ImageUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="DisplayTitle"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetTitle"&gt;&lt;br /&gt;&lt;xsl:with-param name="Title" select="@Title"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="LinkTarget"&gt;&lt;br /&gt;&lt;xsl:if test="@OpenInNewWindow = 'True'"&gt;_blank&lt;/xsl:if&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;div id="linkitem" class="dateFont"&gt;&lt;br /&gt;&lt;xsl:if test="string-length($SafeImageUrl) != 0"&gt;&lt;br /&gt;&lt;div class="lightB"&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/%7B$SafeLinkUrl%7D" target="{$LinkTarget}"&gt;&lt;br /&gt;&lt;img class="image" src="http://www.blogger.com/%7B$SafeImageUrl%7D" alt="{@ImageUrlAltText}" /&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/xsl:if&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;          &lt;tbody&gt;&lt;tr&gt;            &lt;td class="SingleLine"&gt;&lt;br /&gt; &lt;xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"&gt;&lt;br /&gt; &lt;a href="http://www.blogger.com/%7B$SafeLinkUrl%7D" target="{$LinkTarget}" title="{@LinkToolTip}"&gt;&lt;br /&gt;   &lt;xsl:value-of select="$DisplayTitle"&gt;&lt;br /&gt; &lt;/xsl:value-of&gt;&lt;/a&gt;&lt;br /&gt;&lt;/xsl:call-template&gt;&lt;/td&gt;          &lt;/tr&gt;          &lt;tr&gt;            &lt;td&gt;&lt;br /&gt; &lt;div class="dateFont"&gt;&lt;br /&gt;   &lt;xsl:value-of select="@Description"&gt;&lt;br /&gt; &lt;/xsl:value-of&gt;&lt;/div&gt;&lt;br /&gt;&lt;/td&gt;          &lt;/tr&gt;        &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/xsl:param&gt;&lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family:Verdana;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;mso-ansi-language: EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"&gt;// DoubleLine style&lt;/span&gt;&lt;/b&gt;&lt;div&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family:Verdana;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;mso-ansi-language: EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b style="mso-bidi-font-weight:normal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family:Verdana;mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;mso-bidi-font-family:&amp;quot;Times New Roman&amp;quot;;mso-ansi-language: EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;&lt;xsl:template name="DoubleLine" match="Row[@Style='DoubleLine']" mode="itemstyle"&gt;&lt;br /&gt;&lt;xsl:param name="GroupPosition"&gt;&lt;br /&gt;&lt;xsl:variable name="SafeLinkUrl"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetSafeLink"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="SafeImageUrl"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetSafeStaticUrl"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'ImageUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="DisplayTitle"&gt;&lt;br /&gt;&lt;xsl:call-template name="OuterTemplate.GetTitle"&gt;&lt;br /&gt;&lt;xsl:with-param name="Title" select="@Title"&gt;&lt;br /&gt;&lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"&gt;&lt;br /&gt;&lt;/xsl:with-param&gt;&lt;/xsl:with-param&gt;&lt;/xsl:call-template&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;xsl:variable name="LinkTarget"&gt;&lt;br /&gt;&lt;xsl:if test="@OpenInNewWindow = 'True'"&gt;_blank&lt;/xsl:if&gt;&lt;br /&gt;&lt;/xsl:variable&gt;&lt;br /&gt;&lt;div id="linkitem" class="dateFont"&gt;&lt;br /&gt;&lt;xsl:if test="string-length($SafeImageUrl) != 0"&gt;&lt;br /&gt;&lt;div class="lightB"&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/%7B$SafeLinkUrl%7D" target="{$LinkTarget}"&gt;&lt;br /&gt;&lt;img class="image" src="http://www.blogger.com/%7B$SafeImageUrl%7D" alt="{@ImageUrlAltText}" /&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/xsl:if&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;          &lt;tbody&gt;&lt;tr&gt;            &lt;td class="SingleLine"&gt;&lt;br /&gt;  &lt;xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"&gt;&lt;br /&gt;  &lt;a href="http://www.blogger.com/%7B$SafeLinkUrl%7D" target="{$LinkTarget}" title="{@LinkToolTip}"&gt;&lt;br /&gt;    &lt;xsl:value-of select="$DisplayTitle"&gt;&lt;br /&gt;  &lt;/xsl:value-of&gt;&lt;/a&gt;&lt;br /&gt;&lt;/xsl:call-template&gt;&lt;/td&gt;          &lt;/tr&gt;          &lt;tr&gt;            &lt;td class="SingleLine"&gt;&lt;br /&gt;  &lt;img src="http://www.blogger.com/post-edit.g?blogID=12212983&amp;amp;postID=3604831908665183639" /&gt;&lt;br /&gt;    &lt;xsl:attribute name="height"&gt;1&lt;/xsl:attribute&gt;&lt;br /&gt;    &lt;xsl:attribute name="src"&gt;spacer.gif&lt;/xsl:attribute&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;          &lt;/tr&gt;        &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div class="dateFont"&gt;&lt;br /&gt;&lt;xsl:value-of select="@Description"&gt;&lt;br /&gt;&lt;/xsl:value-of&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/xsl:param&gt;&lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1; tab-stops:list .5in"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt; font-family:Arial;mso-fareast-font-family:Arial;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;3.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Now upload updated ItemStyle.xsl in the library.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1; tab-stops:list .5in"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt; font-family:Arial;mso-fareast-font-family:Arial;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;4.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;After uploading the ItemStyle.xsl in the library, newly created styles are available in the item style:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1; tab-stops:list .5in"&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_DNTmIzDGQLg/TS6j19WYY7I/AAAAAAAAAes/e1udVd8nXvc/s1600/Amit_Kumar_1.GIF"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 387px; height: 400px;" src="http://4.bp.blogspot.com/_DNTmIzDGQLg/TS6j19WYY7I/AAAAAAAAAes/e1udVd8nXvc/s400/Amit_Kumar_1.GIF" border="0" alt="" id="BLOGGER_PHOTO_ID_5561562737245971378" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1; tab-stops:list .5in"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size:9.5pt; font-family:Arial;mso-fareast-font-family:Arial;color:black"&gt;&lt;span style="mso-list:Ignore"&gt;&lt;BR&gt;&lt;BR&gt;5.&lt;span style="font:7.0pt &amp;quot;Times New Roman&amp;quot;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size:9.5pt;font-family:Arial; mso-fareast-font-family:&amp;quot;Times New Roman&amp;quot;;color:black"&gt;Now, if we create new link items by using newly created styles:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; margin-left:.5in;text-indent:-.25in;line-height:normal;mso-list:l0 level1 lfo1; tab-stops:list .5in"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://4.bp.blogspot.com/_DNTmIzDGQLg/TS6j2CgzxJI/AAAAAAAAAe0/HRwHzsEnd3I/s400/Amit_Kumar_2.GIF" style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 178px; height: 182px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5561562738631885970" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;BR&gt;&lt;BR&gt;&lt;b&gt;Reference&lt;/b&gt;: MSDN (http://msdn.microsoft.com/en-us/library/ms551040(v=office.12).aspx)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-3604831908665183639?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/3604831908665183639/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=3604831908665183639" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3604831908665183639?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3604831908665183639?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/9vtjD2emgjw/customizing-styles-of-summary-links-web.html" title="Customizing Styles of Summary Links Web Parts" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_DNTmIzDGQLg/TS6j19WYY7I/AAAAAAAAAes/e1udVd8nXvc/s72-c/Amit_Kumar_1.GIF" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2011/01/customizing-styles-of-summary-links-web.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0UEQHc8cCp7ImA9Wx9SEkU.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-8093079952001738234</id><published>2010-12-02T15:14:00.008+05:30</published><updated>2010-12-02T15:50:01.978+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-02T15:50:01.978+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="SpList" /><category scheme="http://www.blogger.com/atom/ns#" term="SPFieldType" /><category scheme="http://www.blogger.com/atom/ns#" term="SPSite" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Document Library" /><category scheme="http://www.blogger.com/atom/ns#" term="add desired columns" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Object Model" /><category scheme="http://www.blogger.com/atom/ns#" term="SPWeb" /><category scheme="http://www.blogger.com/atom/ns#" term="Using C#" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint List C# example" /><title>Create SharePoint List/Document Library using programming</title><content type="html">&lt;strong&gt;Create SharePoint List/Document Library using C#&lt;br /&gt;(How-To: Create a SharePoint list programmatically/Create a list/Add a Custom List to SharePoint/Programmatically create a custom SharePoint list):&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Overview:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In one of my project, i am having requirements of list SharePoint List logging. For this, i required a SharePoint. I can create a SharePoint List by following way:&lt;br /&gt;&lt;br /&gt;Create a SharePoint List by directly accessing the SharePoint Site&lt;br /&gt;Create a SharePoint List with the help of SharePoint Object Model (&lt;a href='http://msdn.microsoft.com/en-us/library/microsoft.sharepoint(v=office.12).aspx' target='_blank'&gt;Microsoft.SharePoint namespace&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;I adopted the second case in my windows application project.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Below are steps in detail.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Create a &lt;a href='http://www.w3schools.com/Schema/schema_howto.asp' target='_blank'&gt;xml file&lt;/a&gt; with name ListDetails.xml and copy following text in to that xml file: &lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="utf-8" ?&gt;&lt;br /&gt;&lt;Lists Destination="http://http://amitkumarmca04.blogspot.com/sites/Test"&gt;&lt;br /&gt; &lt;List Name="Employee" Description="This list stores report of Move to Archive Process."&gt;&lt;br /&gt;  &lt;Columns&gt;&lt;br /&gt;   &lt;Column Name="EmployeeName" DataType="Text" Description="EmployeeName" /&gt;&lt;br /&gt;   &lt;Column Name="EmployeeDepartment" DataType="Text" Description="EmployeeDepartment"/&gt;&lt;br /&gt;  &lt;/Columns&gt;&lt;br /&gt; &lt;/List&gt;&lt;br /&gt;&lt;/Lists&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Create a .cs file and add following code:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private SPFieldType GetFieldType(string fieldType)&lt;br /&gt;{&lt;br /&gt;SPFieldType fieldTypeForColumn = SPFieldType.Text;&lt;br /&gt;// Get the field type.&lt;br /&gt;switch (fieldType)&lt;br /&gt;{&lt;br /&gt;case "Text":&lt;br /&gt;fieldTypeForColumn = SPFieldType.Text;&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;case "Choice":&lt;br /&gt;fieldTypeForColumn = SPFieldType.Choice;&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;case "Note":&lt;br /&gt;fieldTypeForColumn = SPFieldType.Note;&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;return fieldTypeForColumn;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void AddFieldsToList(SPList referenceList, XmlNodeList columnsList)&lt;br /&gt;{&lt;br /&gt;// Variable Initialization.&lt;br /&gt;SPField listField = null;&lt;br /&gt;SPFieldType fieldType;&lt;br /&gt;SPView listDefaultView = null;&lt;br /&gt;SPFieldText fieldText = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;foreach (XmlNode column in columnsList)&lt;br /&gt;{&lt;br /&gt;fieldType = GetFieldType(column.Attributes["DataType"].Value as string);&lt;br /&gt;// Create the field&lt;br /&gt;listField = referenceList.Fields.CreateNewField(fieldType.ToString(), column.Attributes["Name"].Value) as SPField;&lt;br /&gt;// Set Various properties for the field.&lt;br /&gt;listField.AllowDeletion = true;&lt;br /&gt;listField.Description = column.Attributes["Description"].Value;&lt;br /&gt;&lt;br /&gt;// Set the required properties for the column.&lt;br /&gt;listField.ShowInDisplayForm = true;&lt;br /&gt;listField.ShowInEditForm = true;&lt;br /&gt;listField.ShowInListSettings = true;&lt;br /&gt;listField.ShowInNewForm = true;&lt;br /&gt;listField.ShowInVersionHistory = true;&lt;br /&gt;referenceList.Fields.Add(listField);&lt;br /&gt;// Add the column to the view of the list.&lt;br /&gt;listDefaultView = referenceList.Views[0] as SPView;&lt;br /&gt;listDefaultView.ViewFields.Add(column.Attributes["Name"].Value);&lt;br /&gt;listDefaultView.Update();&lt;br /&gt;referenceList.Update();&lt;br /&gt;&lt;br /&gt;// Set the maximum length&lt;br /&gt;if (fieldType.ToString().Equals(SPFieldType.Text.ToString(), StringComparison.InvariantCultureIgnoreCase) &amp;&amp; column.Attributes["MaximumLength"] != null)&lt;br /&gt;{&lt;br /&gt;fieldText = referenceList.Fields[column.Attributes["Name"].Value] as SPFieldText;&lt;br /&gt;fieldText.MaxLength = Convert.ToInt32(column.Attributes["MaximumLength"].Value);&lt;br /&gt;fieldText.Update();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch (Exception e)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public SPList CheckListExist(string strListName, SPWeb objWeb)&lt;br /&gt;{&lt;br /&gt;SPList objList = null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;//---Check list exist or not&lt;br /&gt;if (objWeb.Lists[strListName] != null)&lt;br /&gt;{&lt;br /&gt;objList = objWeb.Lists[strListName] as SPList;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch&lt;br /&gt;{&lt;br /&gt;objList = null;&lt;br /&gt;}&lt;br /&gt;return objList;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public SPList CreateReportList(string strXMLPath)&lt;br /&gt;{&lt;br /&gt;SPList objList = null;&lt;br /&gt;XmlDocument xmlListDetailsDoc = new XmlDocument();&lt;br /&gt;XmlNode objListNode = null;&lt;br /&gt;XmlNodeList columnsList = null;&lt;br /&gt;string urlSite = string.Empty;&lt;br /&gt;string listName = string.Empty;&lt;br /&gt;string description = string.Empty;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;xmlListDetailsDoc.Load(strXMLPath);&lt;br /&gt;// Get the URL&lt;br /&gt;urlSite = xmlListDetailsDoc.SelectSingleNode("Lists").Attributes[0].Value;&lt;br /&gt;// Get the list Node.&lt;br /&gt;objListNode = xmlListDetailsDoc.SelectSingleNode("Lists/List");&lt;br /&gt;// Process each list node and create/retrieve the list.&lt;br /&gt;    using (SPSite referenceSite = new SPSite(urlSite))&lt;br /&gt;    {&lt;br /&gt;          using (SPWeb referenceWeb = referenceSite.OpenWeb())&lt;br /&gt;          {&lt;br /&gt;                listName = objListNode.Attributes[0].Value;&lt;br /&gt;                description = objListNode.Attributes[1].Value;&lt;br /&gt;&lt;br /&gt;                  if (!string.IsNullOrEmpty(listName))&lt;br /&gt;                  {&lt;br /&gt;                    //Check list exist or not&lt;br /&gt;                    objList = CheckListExist(listName, referenceWeb);&lt;br /&gt;                    if(objList==null)&lt;br /&gt;                    {&lt;br /&gt;                      //Create the list.&lt;br /&gt;                      SPListTemplateType templateType = SPListTemplateType.GenericList;&lt;br /&gt;                      Guid referenceListId = referenceWeb.Lists.Add(listName, description, templateType);&lt;br /&gt;                      objList = referenceWeb.Lists[referenceListId];&lt;br /&gt;                      // Set that the list can be displayed in quick launch.&lt;br /&gt;                      objList.OnQuickLaunch = true;&lt;br /&gt;                      // Create the columns in the list.&lt;br /&gt;                      columnsList = objListNode.SelectNodes("Columns/Column");&lt;br /&gt;                      if (columnsList != null &amp;&amp; columnsList.Count &gt; 0)&lt;br /&gt;                          {&lt;br /&gt;                          AddFieldsToList(objList, columnsList);&lt;br /&gt;                          }&lt;br /&gt;                      }&lt;br /&gt;                    }&lt;br /&gt;          }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;catch (Exception e)&lt;br /&gt;{&lt;br /&gt;objList = null;&lt;br /&gt;}&lt;br /&gt;return objList;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Call the function CreateReportList(&lt;Pass the complete path of ListDetails.xml&gt;) .&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;With the help of above mentioned steps you can create a SharePoint List using SharePoint Object Model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-8093079952001738234?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/8093079952001738234/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=8093079952001738234" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/8093079952001738234?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/8093079952001738234?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/ZTIXgvt49XM/create-sharepoint-listdocument-library.html" title="Create SharePoint List/Document Library using programming" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2010/12/create-sharepoint-listdocument-library.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAMQXc4eip7ImA9Wx5bFUg.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-140487881726450897</id><published>2010-11-01T01:19:00.006+05:30</published><updated>2010-11-01T01:56:20.932+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-01T01:56:20.932+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="web.config" /><category scheme="http://www.blogger.com/atom/ns#" term="public private cryptography" /><category scheme="http://www.blogger.com/atom/ns#" term="amit kumar" /><category scheme="http://www.blogger.com/atom/ns#" term="Windows Data Protection" /><category scheme="http://www.blogger.com/atom/ns#" term="AppSettings" /><category scheme="http://www.blogger.com/atom/ns#" term="RSA Algorithm" /><category scheme="http://www.blogger.com/atom/ns#" term="RSA provider" /><category scheme="http://www.blogger.com/atom/ns#" term="troubleshoot" /><category scheme="http://www.blogger.com/atom/ns#" term="ASP.Net 2.0" /><category scheme="http://www.blogger.com/atom/ns#" term="DPAPI" /><category scheme="http://www.blogger.com/atom/ns#" term="API" /><category scheme="http://www.blogger.com/atom/ns#" term="Encrypting" /><category scheme="http://www.blogger.com/atom/ns#" term="encryption" /><category scheme="http://www.blogger.com/atom/ns#" term="RSACryptoServiceProvider" /><title>Encrypting Web.Config using RSAProtectedConfigurationProvider in SharePoint Using C#</title><content type="html">&lt;b&gt;Encrypting Web.Config Values&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Overview:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;One of the most common uses of the protected configuration is to encrypt connection strings in web.confg (that's one of the reasons for creating a separate tag for connection strings instead of adding it in appSettings tag). Adding this connection string as plain text is not the best practice for sharepoint web application security and this might cause serious hacking problems. Sharepoint also support for encrypting and decrypting configuration sections in web.config file. In this article, we will explore how to encrypt and decrypt sections of the web.config. We can encrypt the configuration sections by using two built-in providers: &lt;a href="http://msdn.microsoft.com/en-us/library/ms995355.aspx" title="_blank"&gt;DPAPI (Windows Data Protection API) Provider &lt;/a&gt; or the &lt;a href="http://msdn.microsoft.com/en-us/library/aa386988(VS.85).aspx" target="_blank" title="Amit Kumar"&gt;RSA provider&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/aa386988(VS.85).aspx" target="_blank" title="Amit Kumar"&gt;RSA provider&lt;/a&gt; (default) uses an RSA key which holds public and private keys, where as the &lt;a href="http://msdn.microsoft.com/en-us/library/ms995355.aspx" title="_blank" title="Amit Kumar"&gt;DPAPI provider&lt;/a&gt; uses built-in machine-specific key. Let us explore the steps required to encrypt the sections using RSA.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Below are steps in detail.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1:&lt;/b&gt; Add a web.config file to the project. Right click the &lt;b&gt;project &gt; Add New Item &gt; Web Configuration File&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 2:&lt;/b&gt; To create the custom configuration section in Web.Config file please create the custom class inherited from ConfigurationSection class.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Web.Configuration;&lt;br /&gt;&lt;br /&gt;namespace Amit.Kumar.GeneralSite.Web.UI&lt;br /&gt;{&lt;br /&gt;   class CustomUpdateProfileSection : ConfigurationSection&lt;br /&gt;   {&lt;br /&gt;       private static CustomUpdateProfileSection settings = ConfigurationManager.GetSection("CustomUpdateProfileSection") as CustomUpdateProfileSection;&lt;br /&gt;       public static CustomUpdateProfileSection Settings&lt;br /&gt;       {&lt;br /&gt;           get&lt;br /&gt;           {&lt;br /&gt;               return settings;&lt;br /&gt;           }&lt;br /&gt;       }&lt;br /&gt;       [ConfigurationProperty("UpdateProfileUserDomain", DefaultValue = "v4", IsRequired = true)]&lt;br /&gt;       public string UpdateProfileUserDomain&lt;br /&gt;       {&lt;br /&gt;           get { return (string)this["UpdateProfileUserDomain"]; }&lt;br /&gt;           set { this["UpdateProfileUserDomain"] = value; }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       [ConfigurationProperty("UpdateProfileUserName", IsRequired = true)]&lt;br /&gt;       public string UpdateProfileUserName&lt;br /&gt;       {&lt;br /&gt;           get { return (string)this["UpdateProfileUserName"]; }&lt;br /&gt;           set { this["UpdateProfileUserName"] = value; }&lt;br /&gt;       }&lt;br /&gt;       [ConfigurationProperty("UpdateProfileUserPassword", IsRequired = true)]&lt;br /&gt;       public string UpdateProfileUserPassword&lt;br /&gt;       {&lt;br /&gt;           get { return (string)this["UpdateProfileUserPassword"]; }&lt;br /&gt;           set { this["UpdateProfileUserPassword"] = value; }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 3:&lt;/b&gt; Sign the assembly with the strong name and deploy in the GAC.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 4:&lt;/b&gt; Define the custom section in the Web.Config file&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt; &amp;lt;configSections&amp;gt;&lt;br /&gt;   &amp;lt;section name="CustomUpdateProfileSection" type="Amit.Kumar.GeneralSite.Web.UI.CustomUpdateProfileSection, Amit.Kumar.GeneralSite, Version=3.0.0.0, Culture=neutral, PublicKeyToken=8b7a42e9b9b5355f" /&amp;gt;&lt;br /&gt; &amp;lt;/configSections&amp;gt;&lt;br /&gt; &amp;lt;CustomUpdateProfileSection UpdateProfileUserDomain="v4" UpdateProfileUserName="arpit" UpdateProfileUserPassword="pass" /&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; "&lt;b&gt;Amit.Kumar.GeneralSite.Web.UI.CustomUpdateProfileSection&lt;/b&gt;" is the name of the &lt;b&gt;class&lt;/b&gt;. "&lt;b&gt;Amit.Kumar.GeneralSite&lt;/b&gt;" is the name of the &lt;b&gt;Assembly&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 5:&lt;/b&gt; Now add two buttons to the page, called &lt;b&gt;btnEncrypt &lt;/b&gt;and &lt;b&gt;btnDecrypt&lt;/b&gt;. We will use these buttons to &lt;b&gt;encrypt &lt;/b&gt;and &lt;b&gt;decrypt &lt;/b&gt;the sections of the web.config file. Add the following code in the button click event of the two buttons:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;public void btnEncrypt_OnClick(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;       System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);&lt;br /&gt;       ConfigurationSection objSection = config.GetSection("CustomUpdateProfileSection");&lt;br /&gt;       if ((config != null) &amp;amp;&amp;amp; (!objSection.SectionInformation.IsProtected))&lt;br /&gt;       {&lt;br /&gt;           if (!objSection.ElementInformation.IsLocked)&lt;br /&gt;           {&lt;br /&gt;               objSection.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider");&lt;br /&gt;               config.Save();&lt;br /&gt;               this.lblCustomError.Visible = false;&lt;br /&gt;               this.lblSuccess.Text = "Successfully Encrypted, Kindly check the Web.Config file.";&lt;br /&gt;               this.lblSuccess.Visible = true;&lt;br /&gt;           }                &lt;br /&gt;       }         &lt;br /&gt;            &lt;br /&gt;   }&lt;br /&gt;   catch (Exception ex)&lt;br /&gt;   {&lt;br /&gt;       string strErrorMsg = "Error, DateTime :" + DateTime.Now.ToLongTimeString() + ", Error : " + ex.Message.ToString() + ", Stack Trace : " + ex.StackTrace.ToString();&lt;br /&gt;       this.lblCustomError.Text = strErrorMsg;&lt;br /&gt;       this.lblCustomError.Visible = true;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void btnDecrypt_OnClick(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   try&lt;br /&gt;   {&lt;br /&gt;       System.Configuration.Configuration objConfig = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath);&lt;br /&gt;       ConfigurationSection objSection = objConfig.GetSection("CustomUpdateProfileSection");&lt;br /&gt;       if (objConfig != null &amp;amp;&amp;amp; objSection.SectionInformation.IsProtected)&lt;br /&gt;       {&lt;br /&gt;           if (!objSection.ElementInformation.IsLocked)&lt;br /&gt;           {&lt;br /&gt;               objSection.SectionInformation.UnprotectSection();&lt;br /&gt;               objConfig.Save();&lt;br /&gt;               this.lblCustomError.Visible = false;&lt;br /&gt;               this.lblSuccess.Text = "Successfully Decrypted, Kindly check the Web.Config file.";&lt;br /&gt;               this.lblSuccess.Visible = true;&lt;br /&gt;           }                 &lt;br /&gt;       }              &lt;br /&gt;            &lt;br /&gt;   }&lt;br /&gt;   catch (Exception ex)&lt;br /&gt;   {&lt;br /&gt;       string strErrorMsg = "Error, DateTime :" + DateTime.Now.ToLongTimeString() + ", Error : " + ex.Message.ToString() + ", Stack Trace : " + ex.StackTrace.ToString();&lt;br /&gt;       this.lblCustomError.Text = strErrorMsg;&lt;br /&gt;       this.lblCustomError.Visible = true;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-140487881726450897?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/140487881726450897/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=140487881726450897" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/140487881726450897?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/140487881726450897?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/3hlKbfEk7Pw/encrypting-webconfig-using.html" title="Encrypting Web.Config using RSAProtectedConfigurationProvider in SharePoint Using C#" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2010/11/encrypting-webconfig-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04CQ3c8eip7ImA9Wx5bFU4.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-2861198617814727909</id><published>2010-10-31T19:37:00.004+05:30</published><updated>2010-10-31T20:09:22.972+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-31T20:09:22.972+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ow to Join Technorati" /><category scheme="http://www.blogger.com/atom/ns#" term="Add Technorati Tags to a Blog" /><category scheme="http://www.blogger.com/atom/ns#" term="search engine optimization" /><category scheme="http://www.blogger.com/atom/ns#" term="SEO" /><category scheme="http://www.blogger.com/atom/ns#" term="blogger beta" /><category scheme="http://www.blogger.com/atom/ns#" term="increase blog traffic" /><title>Add Technorati tags in blog posts</title><content type="html">&lt;b&gt;How to Add Technorati Tags to a Blog:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.technorati.com/" title="Amit Kumar" target="_blank"&gt;Technorati&lt;/a&gt; is an Internet search engine for searching blogs. You can increase your blog traffic by adding &lt;a href="http://www.technorati.com/" title="Amit Kumar" target="_blank"&gt;Technorati&lt;/a&gt; tags at the end of your blog posts. This will put your post into the list of posts searchers find on &lt;a href="http://www.technorati.com/" title="Amit Kumar" target="_blank"&gt;Technorati&lt;/a&gt; when searching for the tags you used. Everyday, thousands of visitor search for information through it.&lt;br /&gt;&lt;br /&gt;If your blog is registered in &lt;a href="http://www.technorati.com/" title="Amit Kumar" target="_blank"&gt;Technorati&lt;/a&gt;, a bigger chance it will be seen by visitors.&lt;br /&gt;This can increase your SEO Blog rank.&lt;br /&gt;To register in &lt;a href="http://www.technorati.com/" title="Amit Kumar" target="_blank"&gt;Technorati&lt;/a&gt;, follow below simple steps:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Sign In on Technorati, if not register, please &lt;a href="http://technorati.com/account/signup/" title="Amit Kumar" target="_blank"&gt;Join on Technorati&lt;/a&gt;, follow below simple steps:&lt;br /&gt;&lt;br /&gt;2. Click your account (your userID), it's near signout link.&lt;br /&gt;3. Click Claimed &lt;a href="http://amitkumarmca04.blogspot.com/" title="Amit Kumar" target="_blank"&gt;Blogs&lt;/a&gt; tab.&lt;br /&gt;4. Click Claim a new &lt;a href="http://amitkumarmca04.blogspot.com/" title="Amit Kumar" target="_blank"&gt;blog&lt;/a&gt; link below.&lt;br /&gt;5. Enter your &lt;a href="http://amitkumarmca04.blogspot.com/" title="Amit Kumar" target="_blank"&gt;Blog URL&lt;/a&gt; then click Begin Claim Button.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, your blog is registered in technorati.&lt;br /&gt;&lt;br /&gt;In the next step, i will discuss about how to add technorati tag on every posting.&lt;br /&gt;&lt;br /&gt;1. Login to BLOGGER, go to: "Settings &gt; Template &gt; Edit HTML"&lt;br /&gt;2. Click on 'Expand Widget Templates'&lt;br /&gt;3. Search for class='post-footer-line post-footer-line-2'&lt;br /&gt;4. After below mention code:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;div class="post-footer-line post-footer-line-2"&gt;&lt;span class="post-labels"&gt;&lt;br /&gt;       &lt;b:if cond="data:post.labels"&gt;&lt;br /&gt;         &lt;data:postlabelslabel&gt;&lt;br /&gt;         &lt;b:loop values="data:post.labels" var="label"&gt;&lt;br /&gt;           &lt;a href="data:label.url" rel="tag"&gt;&lt;data:label.name&gt;&lt;/data:label.name&gt;&lt;/a&gt;&lt;b:if cond="data:label.isLast != &amp;quot;true&amp;quot;"&gt;,&lt;/b:if&gt;&lt;br /&gt;         &lt;/b:loop&gt;&lt;br /&gt;       &lt;/data:postlabelslabel&gt;&lt;/b:if&gt;&lt;br /&gt;     &lt;/span&gt; &lt;div class="post-share-buttons"&gt;&lt;br /&gt;       &lt;b:include data="post" name="shareButtons"&gt;&lt;br /&gt;     &lt;/b:include&gt;&lt;/div&gt; &lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;5. Now add following code:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;p class='post-footer-line post-footer-line-2'&gt;&lt;span class='post-labels'&gt;&lt;br /&gt;        &lt;b:if cond='data:post.labels'&gt;&lt;br /&gt;          &lt;b:loop values='data:post.labels' var='label'&gt;&lt;br /&gt;            &lt;a expr:href='"http://technorati.com/tag/" + data:label.name' rel='tag'&gt;&lt;data:label.name/&gt;&lt;/a&gt;&lt;b:if cond='data:label.isLast != "true"'&gt;,&lt;/b:if&gt;&lt;br /&gt;          &lt;/b:loop&gt;&lt;br /&gt;        &lt;/b:if&gt;&lt;br /&gt;      &lt;/span&gt; &lt;/p&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Now, your every blog post display &lt;a href="http://www.technorati.com/" title="Amit Kumar" target="_blank"&gt;Technorati&lt;/a&gt; tags as belw:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;p class='post-footer-line post-footer-line-2'&gt;&lt;span class='post-labels'&gt; &lt;br /&gt;&lt;a href='http://technorati.com/tag/Amit' rel='tag'&gt;Amit&lt;/a&gt;,&lt;br /&gt;&lt;a href='http://technorati.com/tag/AmitKumar' rel='tag'&gt;AmitKumar&lt;/a&gt;,&lt;br /&gt;&lt;a href='http://technorati.com/tag/Amit Kumar' rel='tag'&gt;Amit Kumar&lt;/a&gt;,&lt;br /&gt;&lt;a href='http://technorati.com/tag/SharePoint' rel='tag'&gt;SharePoint&lt;/a&gt;,&lt;br /&gt;&lt;/span&gt; &lt;br /&gt;&lt;/p&gt; &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-2861198617814727909?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/2861198617814727909/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=2861198617814727909" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/2861198617814727909?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/2861198617814727909?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/16rzcTRvZmM/add-technorati-tags-in-blog-posts.html" title="Add Technorati tags in blog posts" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2010/10/add-technorati-tags-in-blog-posts.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ck4HRH8ycCp7ImA9Wx5bEUo.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-7710379525288622326</id><published>2010-10-22T19:47:00.005+05:30</published><updated>2010-10-27T14:45:35.198+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-27T14:45:35.198+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="UserProfile webservice" /><category scheme="http://www.blogger.com/atom/ns#" term="webpartzone" /><category scheme="http://www.blogger.com/atom/ns#" term="SPSite" /><category scheme="http://www.blogger.com/atom/ns#" term="Using" /><category scheme="http://www.blogger.com/atom/ns#" term="C-Sharp" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Object Model" /><category scheme="http://www.blogger.com/atom/ns#" term="custom web part" /><category scheme="http://www.blogger.com/atom/ns#" term="custom user control" /><category scheme="http://www.blogger.com/atom/ns#" term="Customizing web part in SharePoint" /><category scheme="http://www.blogger.com/atom/ns#" term="C#" /><category scheme="http://www.blogger.com/atom/ns#" term="sharepoint moss 2007" /><category scheme="http://www.blogger.com/atom/ns#" term="SPLimitedWebPartManager" /><title>Add Web Part to page using C# code in SharePoint</title><content type="html">&lt;b&gt;Add Web Part to page using C# code in SharePoint:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In MOSS 2007 or WSS 3.0 sites we can add or remove the web part from SharePoint page, using the options available in site.  We can also add web part into a page using &lt;a href="http://msdn.microsoft.com/en-us/library/ms473633(v=office.12).aspx" target="_blank"&gt;SharePoint Object Model&lt;/a&gt;.  To add web part into a page, we will use &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.splimitedwebpartmanager(v=office.12).aspx" target="_blank"&gt;SPLimitedWebPartManager class&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SPLimitedWebPartManager class: &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Provides a limited set of Web Part operations that can be performed in our object model scenarios when there is no HttpContext and no Page object is instantiated.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Example 1: Add web part to a page by passing page Url, webPart Name, zoneID and zoneIndex:-&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;Using Microsoft.Sharepoint;&lt;br /&gt;Using System.Web.UI.WebControls.WebParts;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static string AddWebPartToPage(&lt;br /&gt;            SPWeb web,&lt;br /&gt;            string pageUrl,&lt;br /&gt;            string webPartName,&lt;br /&gt;            string zoneID,&lt;br /&gt;            int zoneIndex)&lt;br /&gt;  {&lt;br /&gt;      using (SPLimitedWebPartManager webPartManager = web.GetLimitedWebPartManager(&lt;br /&gt;              pageUrl, PersonalizationScope.Shared))&lt;br /&gt;          {&lt;br /&gt;              using (WebPart webPart =&lt;br /&gt;&lt;br /&gt;CreateWebPart(web, webPartName, webPartManager))&lt;br /&gt;              {&lt;br /&gt;             webPartManager.AddWebPart(webPart, zoneID, zoneIndex);&lt;br /&gt;              return webPart.ID;&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;public static WebPart CreateWebPart(SPWeb web, string webPartName, SPLimitedWebPartManager webPartManager)&lt;br /&gt;  {&lt;br /&gt;      SPQuery qry = new SPQuery();&lt;br /&gt;      qry.Query = String.Format(CultureInfo.CurrentCulture,&lt;br /&gt;          "&lt;where&gt;&lt;eq&gt;&lt;fieldref name="FileLeafRef"&gt;&lt;value type="File"&gt;{0}&lt;/value&gt;&lt;/fieldref&gt;&lt;/eq&gt;&lt;/where&gt;",&lt;br /&gt;          webPartName);&lt;br /&gt;&lt;br /&gt;      SPList webPartGallery = null;&lt;br /&gt;&lt;br /&gt;      if (null == web.ParentWeb)&lt;br /&gt;      {&lt;br /&gt;          webPartGallery = web.GetCatalog(&lt;br /&gt;             SPListTemplateType.WebPartCatalog);&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;      {&lt;br /&gt;          webPartGallery = web.Site.RootWeb.GetCatalog(&lt;br /&gt;             SPListTemplateType.WebPartCatalog);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      SPListItemCollection webParts = webPartGallery.GetItems(qry);&lt;br /&gt;&lt;br /&gt;      XmlReader xmlReader = new XmlTextReader(webParts[0].File.OpenBinaryStream());&lt;br /&gt;      string errorMsg;&lt;br /&gt;      WebPart webPart = webPartManager.ImportWebPart(xmlReader, out errorMsg);&lt;br /&gt;&lt;br /&gt;      return webPart;&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Example 2: Add Content Editor web part to a page by passing site Url and page relative URL:-&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static string AddWebPartToPage(&lt;br /&gt;            string siteURL,&lt;br /&gt;            string pageRelativeUrl,&lt;br /&gt;            )&lt;br /&gt;  {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using (SPSite site = new SPSite(siteURL))&lt;br /&gt;      {&lt;br /&gt;          SPWeb web = site.RootWeb;&lt;br /&gt;          SPFile page = web.GetFile(pageRelativeUrl);&lt;br /&gt;          page.CheckOut();&lt;br /&gt;          using (SPLimitedWebPartManager wpmgr = page.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared))&lt;br /&gt;          {  &lt;br /&gt;              XmlElement p = new XmlDocument().CreateElement("p");   &lt;br /&gt;              p.InnerText = "Hello World";  &lt;br /&gt;              ContentEditorWebPart cewp = new ContentEditorWebPart();&lt;br /&gt;              cewp.Content = p;             &lt;br /&gt;              wpmgr.AddWebPart(cewp, "Header", 0);&lt;br /&gt;          }&lt;br /&gt;          page.CheckIn(String.Empty);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;References for this article:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;http://www.dhirajranka.com/?p=78&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-7710379525288622326?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/7710379525288622326/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=7710379525288622326" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/7710379525288622326?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/7710379525288622326?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/iTBkHNmx-0g/add-web-part-to-page-using-c-code-in.html" title="Add Web Part to page using C# code in SharePoint" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2010/10/add-web-part-to-page-using-c-code-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8DSHY-fip7ImA9Wx5UF0g.&quot;"><id>tag:blogger.com,1999:blog-12212983.post-3305260429073133545</id><published>2010-10-22T18:50:00.029+05:30</published><updated>2010-10-22T19:44:39.856+05:30</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-10-22T19:44:39.856+05:30</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Limit the length of SharePoint Rich Text Box" /><category scheme="http://www.blogger.com/atom/ns#" term="SmartPart" /><category scheme="http://www.blogger.com/atom/ns#" term="fonts colours content editor" /><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Rich Text Box(InputFormTextBox)" /><category scheme="http://www.blogger.com/atom/ns#" term="custom web part" /><category scheme="http://www.blogger.com/atom/ns#" term="custom user control" /><category scheme="http://www.blogger.com/atom/ns#" term="sonofsmartpart" /><category scheme="http://www.blogger.com/atom/ns#" term="WSS 3.0/MOSS 2007" /><title>SharePoint Rich Text Box (InputFormTextBox) Control</title><content type="html">&lt;b&gt;Use of Rich Text Box (InputFormTextBox) Control in SharePoint:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Objective:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In this article, I am going to explain use of RichTextField (InputFormTextBox)  control in SharePoint.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Requirement:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Take an example of one requirement: We need to create newsletter on the basis of user input. The user input can be a normal text or html format text.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Resolution:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In this scenario, we can use SharePoint Rich Text Box (InputFormTextBox) control in a custom webpart/usercontrol. Check the screen shot below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_DNTmIzDGQLg/TMGaL5CkMMI/AAAAAAAAAcY/UcnVoiwJE4k/s1600/AmitKumar.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 166px;" src="http://3.bp.blogspot.com/_DNTmIzDGQLg/TMGaL5CkMMI/AAAAAAAAAcY/UcnVoiwJE4k/s400/AmitKumar.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5530871346468499650" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Ways of using SharePoint Rich Text Box (InputFormTextBox) control:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1.&lt;/b&gt; The following code illustrates how to use SharePoint Rich Text Box (InputFormTextBox) control in user control:&lt;br /&gt;&lt;br /&gt; &lt;b&gt;i.&lt;/b&gt; Add the required directive at the top of the ascx page (if you're using a web user control):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.SharePoint.WebControls" TagPrefix="AmitKumarSPControls" %&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt; &lt;b&gt;ii.&lt;/b&gt; For creating instance of  SharePoint Rich Text Box (InputFormTextBox) control in your ascx (if you're using a web user control):&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;&lt;amitkumarspcontrols:inputformtextbox id="txtNotes" runat="server" maxlength="8000" richtext="true" richtextmode="FullHTML" rows="21" style="height: 270px; width: 700px;" textmode="MultiLine" width="700px"&gt;&lt;br /&gt;&lt;/amitkumarspcontrols:inputformtextbox&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2.&lt;/b&gt; You can also create this type of control completely in code:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;i.&lt;/b&gt; This is available under Microsoft.SharePoint.WebControls namespace (if you're using a custom web part):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;InputFormTextBox richMessage = new InputFormTextBox();&lt;br /&gt;richMessage.RichText = true;&lt;br /&gt;richMessage.RichTextMode = SPRichTextMode.FullHtml;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You may also use following useful properties:&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;richMessage.AllowHyperlink = true;&lt;br /&gt;richMessage.TextMode = TextBoxMode.MultiLine;&lt;br /&gt;richMessage.Wrap = true;&lt;br /&gt;richMessage.Rows = 10;&lt;br /&gt;richMessage.Width = System.Web.UI.WebControls.Unit.Percentage(100);&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;There are a number of properties/attributes that you can set:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;•ID:&lt;/b&gt; control id.&lt;br /&gt;&lt;b&gt;•Text:&lt;/b&gt; the string within the control.&lt;br /&gt;&lt;b&gt;•ErrorMessage:&lt;/b&gt; you can define a custom error message that will be displayed when an error occurs.&lt;br /&gt;&lt;b&gt;•ErrorMessageLabelControl&lt;/b&gt;: you can specify a control id of a control on the page in which the error message will be rendered.&lt;br /&gt;&lt;b&gt;•TextMode:&lt;/b&gt; accepts a value of type TextBoxMode. Possible values are MultiLine, SingleLine and Password. The default is SingleLine.&lt;br /&gt;&lt;b&gt;•Columns:&lt;/b&gt; indicates the width of the text box.&lt;br /&gt;&lt;b&gt;•Rows:&lt;/b&gt; indicates the number of rows that will be displayed. This is only applied if the TextMode property is set to MultiLine.&lt;br /&gt;&lt;b&gt;•RichText:&lt;/b&gt; indicates if a normal text box or a rich text box will be displayed. The default value is false. The text box will only be rendered as a rich text box if the TextMode property is set to MultiLine.&lt;br /&gt;&lt;b&gt;•RichTextBoxMode:&lt;/b&gt; accepts a value of type SPRichTextMode. Possible values are Compatible, FullHtml and HtmlAsXml. The default value is Compatible. this property only applies if the RichText property is set to true.&lt;br /&gt;&lt;b&gt;•AllowHyperlink:&lt;/b&gt; this property only applies if the RichtText property is set to true. The necessary controls to insert hyperlinks and images will be added to the tools pane.&lt;br /&gt;&lt;b&gt;•Direction:&lt;/b&gt;  This orders the controls in the tools pane from left to right or from right to left. The value is of type ContentDirection having values NotSet, LeftToRight, RightToLeft. The default value is NotSet. This property only applies if the RichText property is set to true.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The following code illustrates how to use SharePoint Rich Text Box (InputFormTextBox) control in user control. In this example, I am also validating, value in SharePoint Rich Text Box (InputFormTextBox) control  is empty or not using JavaScript.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;RichTextBoxControl.ascx Code:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="RichTextBoxControl.ascx.cs" Inherits="RichTextBoxControl" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"&lt;br /&gt;    Namespace="Microsoft.SharePoint.WebControls" TagPrefix="AmitKumarSPControls" %&amp;gt;&lt;br /&gt;    &lt;br /&gt;    &lt;style&gt;&lt;br /&gt;&lt;br /&gt;.blackborder_NoneTop{&lt;br /&gt; border:1px solid black;&lt;br /&gt; border-top:none;&lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;.blackTxtLeft {&lt;br /&gt; font-family: Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt; font-size: 11px;&lt;br /&gt; font-weight: bold;&lt;br /&gt; color: #000000;&lt;br /&gt;}&lt;br /&gt;.redMsg { color: #ff0000;&lt;br /&gt;}&lt;br /&gt;   .btn{&lt;br /&gt;  background-image:url('/_layouts/Amit/images/btn.jpg');&lt;br /&gt;  height:22px;&lt;br /&gt;  font-family:Arial;&lt;br /&gt;  padding:0px;&lt;br /&gt;  border:0px;&lt;br /&gt;  color:white;&lt;br /&gt;  font-size:11px;&lt;br /&gt;  font-weight:bold;&lt;br /&gt;  background-repeat:repeat-x;&lt;br /&gt;  padding-left:5px;&lt;br /&gt;  padding-right:5px;&lt;br /&gt; }  &lt;br /&gt; &lt;br /&gt;.bottomBorder {&lt;br /&gt; border-bottom-width: 1px;&lt;br /&gt; border-bottom-style: solid;&lt;br /&gt; border-bottom-color: #000000;&lt;br /&gt;}                                                                   &lt;br /&gt;.bottomBorder TH{                                                                                        &lt;br /&gt;border-bottom: 1px solid black;&lt;br /&gt;}  &lt;br /&gt;&lt;br /&gt;.HeadingWhite {&lt;br /&gt; font-family: Arial, Helvetica, sans-serif;&lt;br /&gt; font-size: 12px;&lt;br /&gt; font-weight: bold;&lt;br /&gt; color: #FFFFFF;&lt;br /&gt; padding:5px;&lt;br /&gt; text-transform:uppercase;&lt;br /&gt;}&lt;br /&gt;     .blueBG {&lt;br /&gt; background-color: #093a80;&lt;br /&gt; font-family:Verdana, Arial, Helvetica, sans-serif;&lt;br /&gt; color:white;&lt;br /&gt;}                                                                                                                                                                                 &lt;br /&gt;    &lt;/style&gt;&lt;br /&gt;    &lt;br /&gt;    &lt;script  type="text/javascript" &gt;&lt;br /&gt;    &lt;br /&gt;function NormalizeTxt(m)&lt;br /&gt;{&lt;br /&gt;    str=""&lt;br /&gt;    &lt;br /&gt;    va=m.length&lt;br /&gt;&lt;br /&gt;    tt=0&lt;br /&gt;    while(tt&lt;va)&lt;br /&gt;    {&lt;br /&gt;        if(m.substring(tt,tt+1)=='&lt;')&lt;br /&gt;        {&lt;br /&gt;         while(m.substring(tt,tt+1)!='&gt;' &amp;&amp; tt&lt;va)&lt;br /&gt;          tt++;&lt;br /&gt;        }&lt;br /&gt;        str+=m.substring(tt,tt+1)&lt;br /&gt;        tt++;&lt;br /&gt;    }&lt;br /&gt;    newStr=str.replace(/&gt;/g,'');&lt;br /&gt;    return newStr;&lt;br /&gt;}&lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;function TextBoxMessageCheck(refNotesId,refNotesClientId)&lt;br /&gt;{&lt;br /&gt; var objNotes= document.getElementById(refNotesClientId);&lt;br /&gt;&lt;br /&gt;   //Rich text box for template content&lt;br /&gt;    var strHtml = RTE_GetEditorDocument(refNotesClientId).body.innerHTML;&lt;br /&gt;    &lt;br /&gt;     var plaintext = strHtml;&lt;br /&gt;     plaintext = plaintext.replace(/&lt;[\w]*&gt;/gi,'');        &lt;br /&gt;     plaintext = plaintext.replace(/&lt;\/[A-Z]*&gt;/gi,''); &lt;br /&gt;     plaintext = plaintext.replace(/&amp;nbsp;/gi,'');&lt;br /&gt;     plaintext = plaintext.replace(/\n/gi,'');&lt;br /&gt;     plaintext = plaintext.replace(/\t/gi,'');&lt;br /&gt;     plaintext = plaintext.replace(/\r/gi,''); &lt;br /&gt;     &lt;br /&gt;     var resultText = NormalizeTxt(plaintext);&lt;br /&gt;     if(resultText == '')&lt;br /&gt;        {&lt;br /&gt;            alert("Please enter value in rich text box");&lt;br /&gt;            return false;&lt;br /&gt;         }&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; return true;&lt;br /&gt;}&lt;br /&gt;    &lt;/script&gt;&lt;br /&gt;    &lt;br /&gt;&lt;table width="98%" border="0" align="center" cellpadding="0" cellspacing="0"&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td height="12"&gt;&amp;nbsp;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td class="blueBG HeadingWhite "&gt;&lt;span class="HeadingWhite"&gt;Rich Text Box Control&lt;/span&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td class="blackborder_NoneTop "&gt;&lt;table width="98%" border="0" align="center" cellpadding="3" cellspacing="1"&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td valign="top"&gt;&lt;table width="100%" border="0" align="center" cellpadding="0" cellspacing="5"&gt;&lt;br /&gt;            &lt;tr&gt;&lt;br /&gt;              &lt;td valign="top" nowrap class="blackTxtLeft" colspan ="2"&gt;Enter Text:&lt;span class="redMsg"&gt;*&lt;/span&gt;&lt;/td&gt;&lt;br /&gt;            &lt;/tr&gt;&lt;br /&gt;            &lt;tr&gt;&lt;br /&gt;              &lt;td colspan="2" valign="top" class="blackTxtLeft"&gt;&lt;br /&gt;                   &lt;table&gt;&lt;br /&gt;                        &lt;tr&gt;&lt;br /&gt;                            &lt;td&gt;&lt;br /&gt;                                &lt;AmitKumarSPControls:InputFormTextBox ID="txtNotes" runat="server" MaxLength="8000"&lt;br /&gt;                                    RichText="true" RichTextMode="FullHTML" Rows="21" Style='height: 270px; width: 700px;'&lt;br /&gt;                                    TextMode="MultiLine" Width="700px"&gt;&lt;br /&gt;                                &lt;/AmitKumarSPControls:InputFormTextBox&gt;&lt;br /&gt;                            &lt;/td&gt;&lt;br /&gt;                        &lt;/tr&gt;&lt;br /&gt;                   &lt;/table&gt;&lt;br /&gt;              &lt;/td&gt;&lt;br /&gt;            &lt;/tr&gt;&lt;br /&gt;        &lt;/table&gt;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;        &lt;tr&gt;&lt;br /&gt;            &lt;td class="bottomBorder" valign="top"&gt;&lt;br /&gt;                &lt;!-- label for displaying error message start--&gt;&lt;br /&gt;                &lt;asp:Label ID="lblMessage" runat="server"  Visible="false"&gt;&lt;/asp:Label&gt;&lt;br /&gt;                &lt;!--Error label end--&gt;&lt;br /&gt;            &lt;/td&gt;&lt;br /&gt;        &lt;/tr&gt;&lt;br /&gt;        &lt;tr&gt;&lt;br /&gt;        &lt;td align="center" valign="top" class="bottomBorder"&gt;&amp;nbsp;&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;      &lt;tr&gt;&lt;br /&gt;        &lt;td align="center" valign="top"&gt;&lt;br /&gt;            &lt;asp:Button ID="btnDisplay" runat="server" CssClass="btn" Text="Display" OnClick="btnDisplay_Click" /&gt;&lt;br /&gt;        &lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;&lt;br /&gt;    &lt;/table&gt;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;  &lt;tr&gt;&lt;br /&gt;    &lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;br /&gt;  &lt;/tr&gt;&lt;br /&gt;&lt;/table&gt;                  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;RichTextBoxControl.ascx.cs Code:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre name="code" class="CSharp"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Configuration;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.Security;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using System.Web.UI.WebControls.WebParts;&lt;br /&gt;using System.Web.UI.HtmlControls;&lt;br /&gt;using System.Text;&lt;br /&gt;using Microsoft.SharePoint;&lt;br /&gt;&lt;br /&gt;public partial class RichTextBoxControl : System.Web.UI.UserControl&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    #region Render Controls and Handle Controls Event&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    #region Handle Page Load Event&lt;br /&gt;    protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (!IsPostBack)&lt;br /&gt;        {&lt;br /&gt;            SetAttibutes();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt;&lt;br /&gt;    #region Handle Display Button Click Event&lt;br /&gt;    protected void btnDisplay_Click(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;        if (!string.IsNullOrEmpty(txtNotes.Text))&lt;br /&gt;        {&lt;br /&gt;           SetMessage(txtNotes.Text.Trim(), lblMessage);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    #endregion&lt;br /&gt;&lt;br /&gt;    #region Helper&lt;br /&gt;&lt;br /&gt;    #region set controls attributes&lt;br /&gt;    private void SetAttibutes()&lt;br /&gt;    {&lt;br /&gt;        //Add JS to the Display button&lt;br /&gt;        btnDisplay.Attributes.Add("OnClick", "return TextBoxMessageCheck('" + txtNotes.ID + "','" + txtNotes.ClientID + "');");&lt;br /&gt;        //&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt;&lt;br /&gt;    #region Show message on the screen&lt;br /&gt;    /// &lt;summary&gt;&lt;br /&gt;    /// This method makes the lblMessage object visible to the page and set its Text property to the message provided.&lt;br /&gt;    /// &lt;/summary&gt;&lt;br /&gt;    /// &lt;param name="message"&gt;The string value assigned to the Text property of the lblMessage object.&lt;/param&gt;&lt;br /&gt;    private void SetMessage(string message, Label lblMessage)&lt;br /&gt;    {&lt;br /&gt;        if (lblMessage != null)&lt;br /&gt;        {&lt;br /&gt;            lblMessage.Visible = true;&lt;br /&gt;            lblMessage.Text = message;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            Page.Response.Write(message);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    #endregion&lt;br /&gt;&lt;br /&gt;    #endregion&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can deploy custom user control in SharePoint with the help of SonofSmartPart Web part.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;References for this article:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.inputformtextbox.aspx&lt;br /&gt;&lt;br /&gt;http://smartpart.codeplex.com/releases/view/10697&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12212983-3305260429073133545?l=amitkumarmca04.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel="replies" type="application/atom+xml" href="http://amitkumarmca04.blogspot.com/feeds/3305260429073133545/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=12212983&amp;postID=3305260429073133545" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3305260429073133545?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/12212983/posts/default/3305260429073133545?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/amitkuar/~3/puXiVftEauA/sharepoint-rich-text-box.html" title="SharePoint Rich Text Box (InputFormTextBox) Control" /><author><name>Amit Kumar</name><uri>http://www.blogger.com/profile/02776805344297541434</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="24" height="32" src="http://3.bp.blogspot.com/-fiOFgylhals/TgrBrG5ewSI/AAAAAAAAAiI/hJmv882Q3xg/s220/IMG_3325.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_DNTmIzDGQLg/TMGaL5CkMMI/AAAAAAAAAcY/UcnVoiwJE4k/s72-c/AmitKumar.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://amitkumarmca04.blogspot.com/2010/10/sharepoint-rich-text-box.html</feedburner:origLink></entry></feed>

