<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3956357473933224479</id><updated>2024-11-01T01:42:11.927-07:00</updated><title type='text'>SharePoint Customization</title><subtitle type='html'>SharePoint Customization</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-6250141684572651810</id><published>2014-04-21T02:55:00.000-07:00</published><updated>2014-04-21T02:55:23.672-07:00</updated><title type='text'>Display loading image when adding item in SharePoint list</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Today i am going to explain how to show loading/Progress image in SharePoint list new form when new item is added.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Please follow below steps.&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;First you need to download any animated .gif image named it as &quot;Loading.gif&quot;. In this example i have used Site Asset library to store the image.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Open the list in which you want to show this loading image and click on new item link.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;SharePoint list NewForm.aspx will open.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now edit the NewForm.aspx page.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Add the content editor web-part above the existing web-part.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now add below script,css and image tag by edit the html in content editor web-part.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimQE68cR0BPLQ2PfY15exwJFPhP3sNJbD8ni2y1WBV-K8ig6u0nSsUgzHsc_A900UW6KEHiEQjv_g6SeKs9lB9F30LAlRJyVihx9gIudT6EkSTl2Rv-lMLRuGSd3TtcGfo2ALGfVtlJ0Py/s1600/Edit+HTML.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimQE68cR0BPLQ2PfY15exwJFPhP3sNJbD8ni2y1WBV-K8ig6u0nSsUgzHsc_A900UW6KEHiEQjv_g6SeKs9lB9F30LAlRJyVihx9gIudT6EkSTl2Rv-lMLRuGSd3TtcGfo2ALGfVtlJ0Py/s1600/Edit+HTML.png&quot; height=&quot;291&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot; type=&quot;text/javascript&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;style type=&quot;text/css&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;#imgLoading{display:none;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;function PreSaveItem()&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; $(&quot;#imgLoading&quot;).css(&quot;display&quot;, &quot;block&quot;);&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; if (&quot;function&quot; == typeof (PreSaveAction)) {&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return PreSaveAction();&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; return true;&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;div style=&quot;padding-top: 10px; padding-left: 230px;&quot;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;img width=&quot;100&quot; height=&quot;100&quot; id=&quot;imgLoading&quot; src=&quot;/sites/samplesite/SiteAssets/Loading.gif&quot; alt=&quot;&quot;/&amp;gt;&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;7. Save the page.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;8. Now add item to the&amp;nbsp;SharePoint&amp;nbsp;list.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4E3otVHd6rxJMFjS_TAWOB0SbjGt8ROVGTqePwctekcwLz2OjdYcFJkEAZ4mrjX_2vKdXkh6RBi6swewrVB1et2xLumZwysRP7pM8ET8Mn-07K_Fva_TAYl232iPl2yB-v3tF_sDj-oo2/s1600/Progess+symbol+in+Sharepoint+item+event+receiver+add+item.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4E3otVHd6rxJMFjS_TAWOB0SbjGt8ROVGTqePwctekcwLz2OjdYcFJkEAZ4mrjX_2vKdXkh6RBi6swewrVB1et2xLumZwysRP7pM8ET8Mn-07K_Fva_TAYl232iPl2yB-v3tF_sDj-oo2/s1600/Progess+symbol+in+Sharepoint+item+event+receiver+add+item.png&quot; height=&quot;205&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; 9. Once you click on Save button it will showing process image as below.&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigVppK4BEAEia73yDPoCsrMDI800lf_hkWQZGl0CkiFwHbv7T11zmdthmz5xWlywUl0rS3ZXahMB4729KLYsQZNjoPtU1TFiZDIdK8doByir7700AKu-KjMNNzvPg372zu_Lt2cjZkczmK/s1600/Progess+symbol+in+Sharepoint+item+event+receiver.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigVppK4BEAEia73yDPoCsrMDI800lf_hkWQZGl0CkiFwHbv7T11zmdthmz5xWlywUl0rS3ZXahMB4729KLYsQZNjoPtU1TFiZDIdK8doByir7700AKu-KjMNNzvPg372zu_Lt2cjZkczmK/s1600/Progess+symbol+in+Sharepoint+item+event+receiver.png&quot; height=&quot;205&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;In this example we are catching the&amp;nbsp;PreSaveItem() event of the SharePoint list using&amp;nbsp;JavaScript&amp;nbsp;and we&amp;nbsp;have written the business logic in this event.&lt;/li&gt;
&lt;li&gt;This event is fired when we click on save button in&amp;nbsp;SharePoint&amp;nbsp;NewForm.aspx So the process image will be shown until the item is added&amp;nbsp;to the&amp;nbsp;SharePoint&amp;nbsp;list.&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Enjoy.....&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/6250141684572651810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2014/04/display-loading-image-when-adding-item.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/6250141684572651810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/6250141684572651810'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2014/04/display-loading-image-when-adding-item.html' title='Display loading image when adding item in SharePoint list'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimQE68cR0BPLQ2PfY15exwJFPhP3sNJbD8ni2y1WBV-K8ig6u0nSsUgzHsc_A900UW6KEHiEQjv_g6SeKs9lB9F30LAlRJyVihx9gIudT6EkSTl2Rv-lMLRuGSd3TtcGfo2ALGfVtlJ0Py/s72-c/Edit+HTML.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-8480790351535311235</id><published>2012-10-02T02:39:00.000-07:00</published><updated>2012-10-02T02:39:53.020-07:00</updated><title type='text'>Configure the Form Based Authentication (FBA) In SharePoint 2010</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
1) Today we are going to configure the Form Based Authentication in SharePoint Site.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
2) First open the SQL Server management studio.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
3) Create your new database named it as &quot;TMP_FBA&quot;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
4) Now locate the below path to create a new sql membership tables.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp;(&quot;C:\Windows\Microsoft.NET\Framework64\v2.0.50727&quot;)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
5) Find the&amp;nbsp;&lt;b&gt;aspnet_regsql.exe and r&lt;/b&gt;un it to create new tables to store the FBA Users.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
6) So when this exe will run the number of tables will created as shown in screen shots.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz0ujvQ69lxw_TBlwEUwgBiDnCUvkdKxRnlkMO9NUG9sEavO4rijsVOk9Z1W1JlfqpPRb3gMRDC3K8tJkZDWBQCiBUMYXDPIsYN4rNKY9TxoDhIzv6g1fa-uSeY5jSbdT3_cY7jPmscYWH/s1600/Tables.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz0ujvQ69lxw_TBlwEUwgBiDnCUvkdKxRnlkMO9NUG9sEavO4rijsVOk9Z1W1JlfqpPRb3gMRDC3K8tJkZDWBQCiBUMYXDPIsYN4rNKY9TxoDhIzv6g1fa-uSeY5jSbdT3_cY7jPmscYWH/s640/Tables.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
7) Now to insert the users into the table , first create a new asp.net website using visual studio.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
8) Open the web.config file for the new asp.net website.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
9) Find the &quot;connectionStrings&quot; tag and replace it with the below line of tags.It will add the connection string &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;path and the configuration of the Membership provider and role provider&amp;nbsp;as shown in Screen Shot.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVhVe6gyc14479mAWmgXD2xUU4aVCa8xrWtBKofKHa6tb87fDIbkvNkCIwwqGtT4OF7e9L8O4FocMHd_FpUyvoR9EOiOSPDzI808VBeoZ94oGG2RbnYMOkAxphVE8-w0PR0LiMpv67kXpw/s1600/0_AspdotnetSite_ConnectionStringAndProvider.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVhVe6gyc14479mAWmgXD2xUU4aVCa8xrWtBKofKHa6tb87fDIbkvNkCIwwqGtT4OF7e9L8O4FocMHd_FpUyvoR9EOiOSPDzI808VBeoZ94oGG2RbnYMOkAxphVE8-w0PR0LiMpv67kXpw/s1600/0_AspdotnetSite_ConnectionStringAndProvider.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
10) I have added my customized tag inside the &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;br /&gt;&amp;nbsp; My Customiztion....&lt;br /&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
So new tags in asp.net websites are&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;connectionStrings&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add name=&quot;SQLConnectionString_TMP_FBA&quot; connectionString=&quot;SERVER=YourServer\SharePoint; database=TMP_FBA; Integrated Security=SSPI;&quot; providerName=&quot;System.Data.SqlClient&quot; /&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/connectionStrings&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;authentication mode=&quot;Forms&quot; /&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;membership defaultProvider=&quot;TMP_FBAMembershipProvider&quot;&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;lt;providers&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; passwordAttemptWindow=&quot;5&quot;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;false&quot;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;requiresQuestionAndAnswer=&quot;true&quot; applicationName=&quot;/&quot; requiresUniqueEmail=&quot;true&quot;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;passwordFormat=&quot;Hashed&quot; description=&quot;Stores and Retrieves membership data from SQL Server&quot;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;name=&quot;TMP_FBAMembershipProvider&quot; type=&quot;System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&amp;lt;/providers&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/membership&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;roleManager defaultProvider=&quot;TMP_FBARoleManager&quot;&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;lt;providers&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; applicationName=&quot;/&quot;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;description=&quot;Stores and retrieves roles from SQL Server&quot; name=&quot;TMP_FBARoleManager&quot;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;type=&quot;System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&amp;lt;/providers&amp;gt;&lt;br /&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/roleManager&amp;gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;&amp;lt;!--Customized Web.Config End--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
11) Check the duplicate tag entries should not be exist.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
12) Now open the Asp.net Administration site by click from the solution explorer for configure the membership provider and role provider as shown in screen shot.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglpBhvIwXWu989D_6kq3K1yPyWiqIWG-pNzxumOrtJORi0wjqB_BYpxWzTWzmwZjpITOjUZN0RNks5OPYPI-Lgg0ifHnzi-nPOe5teQ7g3SApoX7-5eVzJf9XMC0xtcxAbMd7gbTz2VJuO/s1600/OpenAspNetAdminiSite.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglpBhvIwXWu989D_6kq3K1yPyWiqIWG-pNzxumOrtJORi0wjqB_BYpxWzTWzmwZjpITOjUZN0RNks5OPYPI-Lgg0ifHnzi-nPOe5teQ7g3SApoX7-5eVzJf9XMC0xtcxAbMd7gbTz2VJuO/s1600/OpenAspNetAdminiSite.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
13) Go to the Provider tag and Select the membership provider configured by the above config entry modification&amp;nbsp;and select the second link named &quot;Select a different provider for each feature (advanced)&quot; for the Provider settings&amp;nbsp;as shown in screen shot.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0fUwIsnFCuZ_WerBfg33tNYe5TzmY2ejhvzaij1qz0tGqHjikzrP4mUTE4TVAlQIAwHFwmbXY5mseNHkyBtsg7ugqcNfj7LSmz3bGmKLM2H2wP-ZsSwSlqye_xwQ55_cqfftj0TgCX6lA/s1600/SelectSecondLink.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0fUwIsnFCuZ_WerBfg33tNYe5TzmY2ejhvzaij1qz0tGqHjikzrP4mUTE4TVAlQIAwHFwmbXY5mseNHkyBtsg7ugqcNfj7LSmz3bGmKLM2H2wP-ZsSwSlqye_xwQ55_cqfftj0TgCX6lA/s1600/SelectSecondLink.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
14) So select the membership provider as &quot;TMP_FBAMembershipProvider&quot; and role provider as &quot;TMP_FBARoleManager&quot;.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCfTG8VI4R1yOVFfmgYWweEgw0b7Gy6aNo5OB3ncQKA_T-9WDBgWAVT6RomwWQet6PNd7vLVVvUTurWw3Ec4BNzf1cikeudeOHEd3kVII-0FWgLIDYK7_HBu4KFT5j3cYQa6XleUVknKQg/s1600/SelectProvider.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCfTG8VI4R1yOVFfmgYWweEgw0b7Gy6aNo5OB3ncQKA_T-9WDBgWAVT6RomwWQet6PNd7vLVVvUTurWw3Ec4BNzf1cikeudeOHEd3kVII-0FWgLIDYK7_HBu4KFT5j3cYQa6XleUVknKQg/s1600/SelectProvider.jpg&quot; /&gt;&lt;/a&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;
15) Now go to the security tab of the asp.net administration site.Click on Create User link.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4kurM2mrb0E_9w1-w4HWY0B2s6TIXxVMOMNUxURftA7JWqDFhaYyz0Yw2WaHX0qs3UagSc6GgKlsIepUDPkPLozArCkSUdi0ZlVohPyY829n_FFwY2Lh6qLHqV2ofaV9rgcC5VRgn8ADa/s1600/SecurityTab.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;436&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4kurM2mrb0E_9w1-w4HWY0B2s6TIXxVMOMNUxURftA7JWqDFhaYyz0Yw2WaHX0qs3UagSc6GgKlsIepUDPkPLozArCkSUdi0ZlVohPyY829n_FFwY2Lh6qLHqV2ofaV9rgcC5VRgn8ADa/s640/SecurityTab.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
16) Create one user named fbatest1 and fillup the other details and Click the Button Create User.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF-MJKZTLfHHNsXwyuIWHRle8Es9Vz3calZNJEk0P8Nr_rWv-T-yjy1U1tBAw0Xn4kkyA1N3O0zhdar3gilcTI0L8CdkmCUQx8ksDKKHhi58Am2OuSUVR-KCiBO2i4yw3PaCm8YY3-GPhE/s1600/CreateUser.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;528&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjF-MJKZTLfHHNsXwyuIWHRle8Es9Vz3calZNJEk0P8Nr_rWv-T-yjy1U1tBAw0Xn4kkyA1N3O0zhdar3gilcTI0L8CdkmCUQx8ksDKKHhi58Am2OuSUVR-KCiBO2i4yw3PaCm8YY3-GPhE/s640/CreateUser.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
17) Now check the user is added inside the newly created database by go to the sqlserver and select the Database &quot;TMP_FBA&quot; and select the table &quot;dbo.aspnet_Users&quot;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZrDKDVdwqgxmjVbr30Km-WphNojZPMjKiwYFJeXhj3KQbn_LO1IguRUt4lX8iSi2e9aOBUcEBKo5CReCmSX-vwbDTP-DsVaRiy6E1UlIVUnBWO1bcuLRtG2LEORMhJRo8rSdjS0owdrov/s1600/FBAUser.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZrDKDVdwqgxmjVbr30Km-WphNojZPMjKiwYFJeXhj3KQbn_LO1IguRUt4lX8iSi2e9aOBUcEBKo5CReCmSX-vwbDTP-DsVaRiy6E1UlIVUnBWO1bcuLRtG2LEORMhJRo8rSdjS0owdrov/s1600/FBAUser.jpg&quot; /&gt;&lt;/a&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;
18) Once the User is added then create a new webapplication from the Central Admininstation site.&lt;/div&gt;
&lt;div&gt;
Go to the &lt;b&gt;Appllication Management -&lt;/b&gt;&amp;gt; select &lt;b&gt;Manage Web Appplication&amp;nbsp;&lt;/b&gt;-&amp;gt; From the Ribbon click &lt;b&gt;New&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
19) Now One popup window will open then select the &quot;Claim Based Authentication&quot;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDSRj3QPEcZy6_NZkJe_dHha404GQqvuKY7jL2ThyphenhyphenEXmItXoOFk7VuoKVe9f9HLdCMBqJXuggQvKdMk8glo-CIU6k2uHVdZx72YlsGwWKGbILr2tqHuqAX5eBIX8YcPTBsGoBMqpWbs8pZ/s1600/1_Claim_Auth.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;498&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDSRj3QPEcZy6_NZkJe_dHha404GQqvuKY7jL2ThyphenhyphenEXmItXoOFk7VuoKVe9f9HLdCMBqJXuggQvKdMk8glo-CIU6k2uHVdZx72YlsGwWKGbILr2tqHuqAX5eBIX8YcPTBsGoBMqpWbs8pZ/s640/1_Claim_Auth.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
20) Now Enabled the FBA by check the box and add the provider details and click OK to create web new application&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr7E9vHpz_JJ6pME7UMHH76NjNa4KFfvV3Q_sEUb9JGS739rInFw4UDe2zPEUbzicAUpV8jkzEafXZ2kEWF4YpzdOogAWArfbKhnjyOfRVYEPjCq3OE_8RMd-WWuYuJbaD6An5Sm3CfZUi/s1600/2_Providernames.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;640&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjr7E9vHpz_JJ6pME7UMHH76NjNa4KFfvV3Q_sEUb9JGS739rInFw4UDe2zPEUbzicAUpV8jkzEafXZ2kEWF4YpzdOogAWArfbKhnjyOfRVYEPjCq3OE_8RMd-WWuYuJbaD6An5Sm3CfZUi/s640/2_Providernames.jpg&quot; width=&quot;596&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
21) Now we need to change total three web.config files To enable the Form Bases Authentication,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;a) In the &amp;nbsp;the newly created web&amp;nbsp;applications&amp;nbsp;,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;b) In the Central Administration and&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;c) In the Security token site located at &quot;%programfiles%\common files\Microsoft Shared\web server extensions\14\WebServices\SecurityToken&quot;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
22) First we will modify the web application web.config file&lt;/div&gt;
&lt;div&gt;
Open the web.config file of the Web Application and add the connection string as after the &amp;lt;/SharePoint&amp;gt; tag as Shown in screen shot.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQNVxR9LYysgQ0GxAs47uRJAe2CSCk0rVewMHESmSWOZ1p2QD0xjXEz5GCNSQq5vfqm8fzDVkmEUn9u7RRX1KQz4TE9jXjUaPQ_g1TNTINRvkP6zoe-BSyUWbgYCU41aaK1fGD-nuXdfO/s1600/3_WebApp_ConnectionString.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUQNVxR9LYysgQ0GxAs47uRJAe2CSCk0rVewMHESmSWOZ1p2QD0xjXEz5GCNSQq5vfqm8fzDVkmEUn9u7RRX1KQz4TE9jXjUaPQ_g1TNTINRvkP6zoe-BSyUWbgYCU41aaK1fGD-nuXdfO/s1600/3_WebApp_ConnectionString.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&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;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;lt;connectionStrings&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add name=&quot;SQLConnectionString_TMP_FBA&quot; connectionString=&quot;SERVER=YourServer\SharePoint; database=TMP_FBA; Integrated Security=SSPI;&quot; providerName=&quot;System.Data.SqlClient&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;/connectionStrings&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
23) Now we will add the Membership and Role Provider tag in web.config file as shown in the screen shot &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1V0OFbbiz_SHB45POafyLppgijC8PQHILgIv_gGFBRQTtymOgvqbScHwWm57Ol3Y-E5ls_OmYI6ZoH58EPiDaDUFi9KNrDyiabrIe98Hw4dibARn2aj1Ii0SZXQzVQWAUD4gk3Nx68_Ry/s1600/3_WebApp_ConnectionString_Providers.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1V0OFbbiz_SHB45POafyLppgijC8PQHILgIv_gGFBRQTtymOgvqbScHwWm57Ol3Y-E5ls_OmYI6ZoH58EPiDaDUFi9KNrDyiabrIe98Hw4dibARn2aj1Ii0SZXQzVQWAUD4gk3Nx68_Ry/s1600/3_WebApp_ConnectionString_Providers.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;lt;membership defaultProvider=&quot;i&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;i&quot; type=&quot;Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; passwordAttemptWindow=&quot;5&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;false&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; requiresQuestionAndAnswer=&quot;true&quot; applicationName=&quot;/&quot; requiresUniqueEmail=&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; passwordFormat=&quot;Hashed&quot; description=&quot;Stores and Retrieves membership data from SQL Server&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; name=&quot;TMP_FBAMembershipProvider&quot; type=&quot;System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/membership&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;roleManager defaultProvider=&quot;c&quot; enabled=&quot;true&quot; cacheRolesInCookie=&quot;false&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;c&quot; type=&quot;Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; applicationName=&quot;/&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; description=&quot;Stores and retrieves roles from SQL Server&quot; name=&quot;TMP_FBARoleManager&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=&quot;System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/roleManager&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
24) Second we will modify the Central Administration web.config file&lt;/div&gt;
&lt;div&gt;
Open the web.config file of the Central Administration and add the connection string as after the &amp;lt;/SharePoint&amp;gt; tag as Shown in screen shot.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdp34tdul-1D_xiP9AXYXG3nRsrdUPDJWiOTTg76QGIBbEwnRmp3UsZ7BWEmNKP0-r26rkvFEsqkQfgrIhgsbbO5y_M6sybvPFNDkFkVHysX8j5C6x8oq4Yg5C_-F5Xsktb2UG6Qs0lu6-/s1600/4_CentralAdmin_ConnectionString.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdp34tdul-1D_xiP9AXYXG3nRsrdUPDJWiOTTg76QGIBbEwnRmp3UsZ7BWEmNKP0-r26rkvFEsqkQfgrIhgsbbO5y_M6sybvPFNDkFkVHysX8j5C6x8oq4Yg5C_-F5Xsktb2UG6Qs0lu6-/s1600/4_CentralAdmin_ConnectionString.jpg&quot; /&gt;&lt;/a&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;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;connectionStrings&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;add name=&quot;SQLConnectionString&quot; connectionString=&quot;SERVER=YourServer\SharePoint; database=MukeshFBA; Integrated Security=SSPI;&quot; providerName=&quot;System.Data.SqlClient&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;add name=&quot;SQLConnectionString_TMP_FBA&quot; connectionString=&quot;SERVER=YourServer\SharePoint; database=TMP_FBA; Integrated Security=SSPI;&quot; providerName=&quot;System.Data.SqlClient&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;!--Customized Web.Config End--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/connectionStrings&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
25) Now we will add the Membership and Role Provider tag in web.config file as shown in the screen shot &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlLitEkIPSW-cmhOqXheb4_kzDBvdvaTVUAElDubiaagdatAB9PKNEj3bIvUnKb_6talF0M9pYxqdxBM5VwqW_42kFqbR_nE7ZNNeZLdhpdVLJrN3q8KENtHnFSnm2pMR3SI3q1PxRTAfN/s1600/4_CentralAdmin_Provider.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlLitEkIPSW-cmhOqXheb4_kzDBvdvaTVUAElDubiaagdatAB9PKNEj3bIvUnKb_6talF0M9pYxqdxBM5VwqW_42kFqbR_nE7ZNNeZLdhpdVLJrN3q8KENtHnFSnm2pMR3SI3q1PxRTAfN/s1600/4_CentralAdmin_Provider.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;membership&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;lt;add name=&quot;i&quot; type=&quot;Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&amp;gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; passwordAttemptWindow=&quot;5&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;false&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; requiresQuestionAndAnswer=&quot;true&quot; applicationName=&quot;/&quot; requiresUniqueEmail=&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; passwordFormat=&quot;Hashed&quot; description=&quot;Stores and Retrieves membership data from SQL Server&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; name=&quot;SQLConnectionString_TMP_FBA&quot; type=&quot;System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config End--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/membership&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;roleManager&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;lt;add name=&quot;c&quot; type=&quot;Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&amp;gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; applicationName=&quot;/&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; description=&quot;Stores and retrieves roles from SQL Server&quot; name=&quot;TMP_FBARoleManager&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=&quot;System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config End--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&amp;lt;/providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/roleManager&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
26) Third we will modify the Security Token web.config file from &quot;%programfiles%\common files\Microsoft Shared\web server extensions\14\WebServices\SecurityToken&quot; location&lt;/div&gt;
&lt;div&gt;
Open the web.config file of the Central Administration and add the connection string as after the &amp;lt;/system.net&amp;gt; tag as Shown in screen shot.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRRV-k3pir4k8eMM0_BPoAkd8G6hIyBmRk9_QjIj6i2sxMqGE5NUww_LaFgAkKQPSYlAcfOa5obS98Yg5-KdMU8s8Td9L-Q6dfOsN1yPN8Zgqru0xJD731upOJT5Xgt1md9yx3JD8r64Fl/s1600/5_SecurityToken_ConnectionString.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRRV-k3pir4k8eMM0_BPoAkd8G6hIyBmRk9_QjIj6i2sxMqGE5NUww_LaFgAkKQPSYlAcfOa5obS98Yg5-KdMU8s8Td9L-Q6dfOsN1yPN8Zgqru0xJD731upOJT5Xgt1md9yx3JD8r64Fl/s1600/5_SecurityToken_ConnectionString.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;connectionStrings&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;SQLConnectionString&quot; connectionString=&quot;SERVER=YourServer\SharePoint; database=MukeshFBA; Integrated Security=SSPI;&quot; providerName=&quot;System.Data.SqlClient&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;add name=&quot;SQLConnectionString_TMP_FBA&quot; connectionString=&quot;SERVER=YourServer\SharePoint; database=TMP_FBA; Integrated Security=SSPI;&quot; providerName=&quot;System.Data.SqlClient&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;!--Customized Web.Config End--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/connectionStrings&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
27) Now we will add the Membership and Role Provider tag in web.config file as shown in the screen shot&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnvrVOg2x3Cjt0AvMdQj8PbY8um74ex2y2vSIXsFumTPlzXQwSdXnxUZ58CtRyUflb2GxDX6vudPv90jkyNVNzW0u3UzZuqJwSGfYkAwGwW1vvcS7xRtabG9II0-dETKNcqvXSaMg6D8O7/s1600/6_SecurityToken_Privider.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnvrVOg2x3Cjt0AvMdQj8PbY8um74ex2y2vSIXsFumTPlzXQwSdXnxUZ58CtRyUflb2GxDX6vudPv90jkyNVNzW0u3UzZuqJwSGfYkAwGwW1vvcS7xRtabG9II0-dETKNcqvXSaMg6D8O7/s1600/6_SecurityToken_Privider.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;system.web&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;lt;membership defaultProvider=&quot;i&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;i&quot; type=&quot;Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&amp;gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; passwordAttemptWindow=&quot;5&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; enablePasswordRetrieval=&quot;false&quot; enablePasswordReset=&quot;false&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; requiresQuestionAndAnswer=&quot;true&quot; applicationName=&quot;/&quot; requiresUniqueEmail=&quot;true&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; passwordFormat=&quot;Hashed&quot; description=&quot;Stores and Retrieves membership data from SQL Server&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; name=&quot;TMP_FBAMembershipProvider&quot; type=&quot;System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config End--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/membership&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;roleManager defaultProvider=&quot;c&quot; enabled=&quot;true&quot; cacheRolesInCookie=&quot;false&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;add name=&quot;c&quot; type=&quot;Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot; /&amp;gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config Start--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;add connectionStringName=&quot;SQLConnectionString_TMP_FBA&quot; applicationName=&quot;/&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; description=&quot;Stores and retrieves roles from SQL Server&quot; name=&quot;TMP_FBARoleManager&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; type=&quot;System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot; /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;!--Customized Web.Config End--&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/providers&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/roleManager&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
28) Now once the modification in all the web.config file , Create one site collection&lt;/div&gt;
&lt;div&gt;
Open the newly created Site Collection then the below screen will appear&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbhyJCHjZbwrFOIyFz6Xsc15DSxWylEYX3ObuVFh_mlxXqPEb0MyTrKyDd0wuhQnc_wpBRmn5Azy-oAt-POrnTviKKZhdcIpAmC8DvOdbEA7IIeI4AXClM21wTJ8geqvDNarT95Fbz4a-Y/s1600/Login.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbhyJCHjZbwrFOIyFz6Xsc15DSxWylEYX3ObuVFh_mlxXqPEb0MyTrKyDd0wuhQnc_wpBRmn5Azy-oAt-POrnTviKKZhdcIpAmC8DvOdbEA7IIeI4AXClM21wTJ8geqvDNarT95Fbz4a-Y/s640/Login.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
29) Now select the window Authentication , logged in with window credential to Add the FBA user to the Site Collection.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
30) Now from the &quot;Site Permissions&quot; select the appropriate site collection group and add the FBA user.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaFg77CwgBB3uACwiCS0NC3TrassG1WnsAlPM42uct0stLWyaQ42LIyeS0k9gfAKAnfz5F_k0YgXfKZ20dBykLpq6EYI1ls6hHzOJ-L6ZZFPTgFsLg2yP2MEDaX9RVQyf4UVA9HVxJpQO5/s1600/AddFBAUserToSiteCollection.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;307&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaFg77CwgBB3uACwiCS0NC3TrassG1WnsAlPM42uct0stLWyaQ42LIyeS0k9gfAKAnfz5F_k0YgXfKZ20dBykLpq6EYI1ls6hHzOJ-L6ZZFPTgFsLg2yP2MEDaX9RVQyf4UVA9HVxJpQO5/s640/AddFBAUserToSiteCollection.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&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;
31) Once the FBA user is added , sign out as a window authentication and from the sign in page select the &quot;Form Authentication&quot; from the dropdown and add the FBA user&#39;s credential.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHhV7v_iiVyH9_CPvSFGBKIH8PIDza524LzVy-9TEur3jCiX4vX96gU3WFP99wfWElQooE852x1jxVqn4GQ0WUZaN6BXeQTQo1f0_7ooJ37-zKkzQ4KK45_m-vXxq_nepZLbKDPyTPRgfy/s1600/SigninWithForm.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;286&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHhV7v_iiVyH9_CPvSFGBKIH8PIDza524LzVy-9TEur3jCiX4vX96gU3WFP99wfWElQooE852x1jxVqn4GQ0WUZaN6BXeQTQo1f0_7ooJ37-zKkzQ4KK45_m-vXxq_nepZLbKDPyTPRgfy/s640/SigninWithForm.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&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;
32) That&#39;s it , You have configured the Form based authentication...&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/8480790351535311235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/10/configure-form-based-authentication-fba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/8480790351535311235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/8480790351535311235'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/10/configure-form-based-authentication-fba.html' title='Configure the Form Based Authentication (FBA) In SharePoint 2010'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgz0ujvQ69lxw_TBlwEUwgBiDnCUvkdKxRnlkMO9NUG9sEavO4rijsVOk9Z1W1JlfqpPRb3gMRDC3K8tJkZDWBQCiBUMYXDPIsYN4rNKY9TxoDhIzv6g1fa-uSeY5jSbdT3_cY7jPmscYWH/s72-c/Tables.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-5278748162245950354</id><published>2012-07-06T00:02:00.000-07:00</published><updated>2012-07-06T00:02:03.408-07:00</updated><title type='text'>Save the value in sharepoint property bags</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
Hello,&lt;br /&gt;
In this article we will see the sharepoint property bag CRUD operation at different access level( farm level , Web application level , Site Collection level and web level )&lt;br /&gt;
&lt;br /&gt;
Add the property farm level&lt;br /&gt;
---------------------------------&lt;br /&gt;
SPFarm farmObject = SPFarm.Local;&lt;br /&gt;
farmObject .Properties.Add(&quot;PropertyKey&quot;, &quot;PropertyValue&quot;);&lt;br /&gt;
farmObject .Update();&lt;br /&gt;
&lt;br /&gt;
Get the property farm level&lt;br /&gt;
------------------------------------&lt;br /&gt;
SSPFarm farmObject = SPFarm.Local;&lt;br /&gt;
if (farmObject.Properties != null &amp;amp;&amp;amp; farmObject.Properties.Count &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (farmObject.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String propertyValue = myWebApplication.Properties[&quot;PropertyKey&quot;].ToString();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Change the property farm level&lt;br /&gt;
------------------------------------&lt;br /&gt;
SPFarm farmObject = SPFarm.Local;&lt;br /&gt;
if (farmObject.Properties != null &amp;amp;&amp;amp; farmObject.Properties.Count &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (farmObject.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;farmObject.Properties[&quot;PropertyKey&quot;] = &quot;New Property Value&quot;;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; farmObject.Update();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Remove the property farm level&lt;br /&gt;
-------------------------------&lt;br /&gt;
SPFarm farmObject = SPFarm.Local;&lt;br /&gt;
if (farmObject.Properties != null &amp;amp;&amp;amp; farmObject.Properties.Count &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (farmObject.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;farmObject.Properties[&quot;PropertyKey&quot;] = null;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; farmObject.Properties.Remove(&quot;PropertyKey&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; farmObject.Update();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Add the property web application level&lt;br /&gt;
--------------------------------------&lt;br /&gt;
SPWebApplication webApplicationObject = SPWebApplication.Lookup(new Uri(&quot;http://YourWebApplicationURL&quot;));&lt;br /&gt;
webApplicationObject.Properties.Add(&quot;PropertyKey&quot;, &quot;PropertyValue&quot;);&lt;br /&gt;
webApplicationObject.Update();&lt;br /&gt;
&lt;br /&gt;
Get the property web application level&lt;br /&gt;
--------------------------------------&lt;br /&gt;
SPWebApplication webApplicationObject = SPWebApplication.Lookup(new Uri(&quot;http://YourWebApplicationURL&quot;));&lt;br /&gt;
if (webApplicationObject.Properties != null &amp;amp;&amp;amp; webApplicationObject.Properties.Count &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (webApplicationObject.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String propertyValue = webApplicationObject.Properties[&quot;PropertyKey&quot;].ToString();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Change the property web application level&lt;br /&gt;
-------------------------------------------&lt;br /&gt;
SPWebApplication webApplicationObject = SPWebApplication.Lookup(new Uri(&quot;http://YourWebApplicationURL&quot;));&lt;br /&gt;
if (webApplicationObject.Properties != null &amp;amp;&amp;amp; webApplicationObject.Properties.Count &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (webApplicationObject.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;webApplicationObject.Properties[&quot;PropertyKey&quot;] = &quot;New Property Value&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;webApplicationObject.Update();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Remove the property web application level&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
SPWebApplication webApplicationObject = SPWebApplication.Lookup(new Uri(&quot;http://YourWebApplicationURL&quot;));&lt;br /&gt;
if (webApplicationObject.Properties != null &amp;amp;&amp;amp; webApplicationObject.Properties.Count &amp;gt; 0)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (webApplicationObject.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;webApplicationObject.Properties[&quot;PropertyKey&quot;] = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;webApplicationObject.Properties.Remove(&quot;PropertyKey&quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;webApplicationObject.Update();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Add the property site level&lt;br /&gt;
----------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SPWeb rootWeb = site.RootWeb; &amp;nbsp; &lt;br /&gt;
&amp;nbsp; &amp;nbsp; rootWeb.Properties.Add(&quot;PropertyKey&quot;, &quot;PropertyValue&quot;);//In sharepoint there is no any provision to store the property value in SPSite object so we can use the RootWeb object&lt;br /&gt;
&amp;nbsp; &amp;nbsp; rootWeb.Properties.Update(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Get the property site level&lt;br /&gt;
--------------------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SPWeb rootWeb = site.RootWeb; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (rootWeb.Properties != null &amp;amp;&amp;amp; rootWeb.Properties.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (rootWeb.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String propertyValue = rootWeb.Properties[&quot;PropertyKey&quot;].ToString(); &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Change the property site level&lt;br /&gt;
--------------------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SPWeb rootWeb = site.RootWeb; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (rootWeb.Properties != null &amp;amp;&amp;amp; rootWeb.Properties.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (rootWeb.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;rootWeb.Properties[&quot;PropertyKey&quot;] = &quot;New Property Value&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;rootWeb.Update(); &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Remove the property site level&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; SPWeb rootWeb = site.RootWeb; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (rootWeb.Properties != null &amp;amp;&amp;amp; rootWeb.Properties.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (rootWeb.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;rootWeb.Properties[&quot;PropertyKey&quot;] = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;rootWeb.Properties.Remove(&quot;PropertyKey&quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;rootWeb.Update(); &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Add the property web level&lt;br /&gt;
----------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; using(SPWeb web = site.OpenWeb())&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;web.Properties.Add(&quot;PropertyKey&quot;, &quot;PropertyValue&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;web.Properties.Update(); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Get the property web level&lt;br /&gt;
--------------------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; using(SPWeb web = site.OpenWeb())&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (web.Properties != null &amp;amp;&amp;amp; web.Properties.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (web.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;String propertyValue = web.Properties[&quot;PropertyKey&quot;].ToString(); &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Change the property web level&lt;br /&gt;
--------------------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; using(SPWeb web = site.OpenWeb())&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (web.Properties != null &amp;amp;&amp;amp; web.Properties.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (web.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;web.Properties[&quot;PropertyKey&quot;] = &quot;New Property Value&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;web.Update(); &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Remove the property web level&lt;br /&gt;
-----------------------------------------&lt;br /&gt;
using(SPSite site = new SPSite(&quot;http://server:port&quot;))&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; &amp;nbsp; using(SPWeb web = site.OpenWeb())&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if (web.Properties != null &amp;amp;&amp;amp; web.Properties.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if (web.Properties.ContainsKey(&quot;PropertyKey&quot;))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;web.Properties[&quot;PropertyKey&quot;] = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;web.Properties.Remove(&quot;PropertyKey&quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;web.Update(); &amp;nbsp; &amp;nbsp;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Hiren Patel&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/5278748162245950354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/save-value-in-sharepoint-property-bags.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/5278748162245950354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/5278748162245950354'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/save-value-in-sharepoint-property-bags.html' title='Save the value in sharepoint property bags'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-2774885981378698364</id><published>2012-07-05T06:30:00.001-07:00</published><updated>2012-07-05T06:30:52.005-07:00</updated><title type='text'>Custom application page for the sharepoint RSS feeds.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hello in this topic we will develope the custom application page for the sharepoint rss feeds.&lt;br /&gt;
&lt;br /&gt;
- Here the different news(with different content type(1. Sharepoint News Page and 2.Sharepoint Article Page)) is associated with the Sharepoint Pages library.&lt;br /&gt;
And we have created the page library inside the &quot;NewsSite&quot; site.so my news site url will like &quot;http://YourServer:Port/NewsSite/&quot;&lt;br /&gt;
&lt;br /&gt;
- Published date for the &quot;Sharepoint News Page&quot; content type is stored in &quot;PressReleasePublihshedDate&quot; field and&lt;br /&gt;
Published date for the &quot;Sharepoint Article Page&quot; content type is stored in the &quot;PublihshedDate&quot; field.&lt;br /&gt;
&lt;br /&gt;
So above two types of news are stored in the SharePoint pages library.&lt;br /&gt;
&lt;br /&gt;
- We have enabled the &quot;Allow RSS for this list&quot; settings for the Pages library.&lt;br /&gt;
&lt;br /&gt;
- You can enabled it by go to the list settings - &amp;gt; go to the Communications section and click on the Rss Settings - &amp;gt;&lt;br /&gt;
&amp;nbsp; set the &quot;Allow RSS for this list? &quot; is true and press OK.&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
- We will display the news of both the content type together for the rss feeds.&lt;br /&gt;
&lt;br /&gt;
- We will use the custom application page for that and stored it in the &quot;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS&quot; location.&lt;br /&gt;
&lt;br /&gt;
- We will use the application page name as &quot;SharepointCustomRSSFeeds.aspx&quot;&lt;br /&gt;
&lt;br /&gt;
- Now add the following line of code inside the aspx page.&lt;br /&gt;
&lt;br /&gt;
- So SharepointCustomRSSFeeds.aspx application page will look like below&lt;br /&gt;
&lt;br /&gt;
/*******************************************************************************************************************************/&lt;br /&gt;
&amp;lt;%@ Page Language=&quot;C#&quot; %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;%@ Import Namespace=&quot;Microsoft.SharePoint&quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&quot;System.Text&quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&quot;System&quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&quot;System.Data&quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&quot;System.Globalization&quot; %&amp;gt;&lt;br /&gt;
&amp;lt;%@ Import Namespace=&quot;Microsoft.SharePoint.Utilities&quot; %&amp;gt;&lt;br /&gt;
&amp;lt;script runat=&quot;server&quot;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public void Page_Load()&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Response.Clear();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Response.ContentType = &quot;text/xml&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;try&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Response.Write(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;GetRSSFromListView(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Request.QueryString[&quot;List&quot;],&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Request.QueryString[&quot;View&quot;])&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;catch (Exception ex)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Response.Write(&quot;&amp;lt;pre&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Response.Write(ex.ToString());&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Response.Write(&quot;&amp;lt;/pre&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static string GetRSSFromListView(string strListGUID, string strViewGUID)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;StringBuilder sb = new StringBuilder();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(&quot;&amp;lt;?xml version=\&quot;1.0\&quot;?&amp;gt;&quot;);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(&quot;&amp;lt;rss version=\&quot;2.0\&quot;&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Guid listGuid = new Guid(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;HttpContext.Current.Server.UrlDecode(strListGUID));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;string siteUrl = SPContext.Current.Web.Url;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;using (SPSite site = new SPSite(siteUrl))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;using (SPWeb web = site.OpenWeb())&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;SPList list = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;try&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{ list = web.Lists[listGuid]; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;catch { list = null; }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;if (list != null)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;SPView view = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;if (strViewGUID != null)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;Guid viewGuid = new Guid(&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;HttpContext.Current.Server.UrlDecode(strViewGUID));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;view = list.Views[viewGuid];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;else&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;view = list.DefaultView;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;sb.Append(&quot;&amp;lt;channel&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;AddTag(&quot;title&quot;, list.Title, sb);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;AddTag(&quot;description&quot;, list.Description, sb);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;SPListItemCollection items = GetTheRssRecords(list);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;DataTable FianlResults1 = MergedNewsRecords(items);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;DataTable FianlResults = RecordsWithRFCDateFormat(FianlResults1);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;string str=&quot;&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;string str1=&quot;&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;if (FianlResults.Rows.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;foreach (DataRow row in FianlResults.Rows)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;sb.Append(&quot;&amp;lt;item&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;AddTag(&quot;link&quot;, Convert.ToString(row[&quot;FileRef&quot;]), sb);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;AddTag(&quot;title&quot;, Convert.ToString(row[&quot;Title&quot;]), sb);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;IFormatProvider culture = new CultureInfo(SPContext.Current.Web.UICulture.ToString(), true);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;str=&quot;&amp;lt;pubDate&amp;gt;&quot;;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;str+=Convert.ToString(row[&quot;PublishedDate&quot;]);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;str+=&quot;&amp;lt;/pubDate&amp;gt;&quot;;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;sb.Append(str);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;AddTag(&quot;description&quot;,Convert.ToString(&quot;&amp;lt;b style=&#39;font-size:12px&#39;&amp;gt;&quot;+row[&quot;PublishedDate&quot;]+&quot;&amp;lt;/b&amp;gt;&quot;), sb);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;sb.Append(&quot;&amp;lt;/item&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;sb.Append(&quot;&amp;lt;/channel&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;sb.Append(&quot;&amp;lt;/rss&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return sb.ToString();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;private static void AddTag(string tagText, string tagValue, StringBuilder sb)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(&quot;&amp;lt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(tagText.Replace(&quot; &quot;, &quot;_&quot;));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(&quot;&amp;gt;&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(HttpContext.Current.Server.HtmlEncode(tagValue));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(&quot;&amp;lt;/&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(tagText.Replace(&quot; &quot;, &quot;_&quot;));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;sb.Append(&quot;&amp;gt;&quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public static DataTable MergedNewsRecords(SPListItemCollection items)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataTable dtFinalRecords = new DataTable();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataColumn Title = new DataColumn(&quot;Title&quot;, typeof(string));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataColumn FileRef = new DataColumn(&quot;FileRef&quot;, typeof(string));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataColumn PublishedDate = new DataColumn(&quot;PublishedDate&quot;, typeof(DateTime));&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;dtFinalRecords.Columns.Add(Title);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;dtFinalRecords.Columns.Add(FileRef);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;dtFinalRecords.Columns.Add(PublishedDate);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;try&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;foreach (SPListItem item in items)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;if (item.File.Item.ContentType.Name == &quot;Sharepoint News Page&quot; &amp;amp;&amp;amp; !string.IsNullOrEmpty(Convert.ToString(item.Properties[&quot;PressReleasePublihshedDate&quot;])))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;DataRow rowFinal = dtFinalRecords.NewRow();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;Title&quot;] = item.File.Title;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;FileRef&quot;] = item.File.ServerRelativeUrl;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;PublishedDate&quot;] = Convert.ToDateTime(SPUtility.CreateDateTimeFromISO8601DateTimeString(item.Properties[&quot;PressReleasePublihshedDate&quot;].ToString()));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;dtFinalRecords.Rows.Add(rowFinal);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;else if (item.File.Item.ContentType.Name == &quot;Sharepoint Article Page&quot; &amp;amp;&amp;amp; !string.IsNullOrEmpty(Convert.ToString(item.Properties[&quot;PublihshedDate&quot;])))&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;DataRow rowFinal = dtFinalRecords.NewRow();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;Title&quot;] = item.File.Title;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;FileRef&quot;] = item.File.ServerRelativeUrl;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;PublishedDate&quot;] = Convert.ToDateTime(SPUtility.CreateDateTimeFromISO8601DateTimeString(item.Properties[&quot;PublihshedDate&quot;].ToString()));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;dtFinalRecords.Rows.Add(rowFinal);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (dtFinalRecords.Rows.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;DataView viewResults = new DataView(dtFinalRecords);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;viewResults.Sort = &quot;PublishedDate DESC&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;dtFinalRecords = viewResults.ToTable();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;catch {&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return dtFinalRecords;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public static DataTable RecordsWithRFCDateFormat(DataTable items)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataTable dtFinalRecords = new DataTable();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataColumn Title = new DataColumn(&quot;Title&quot;, typeof(string));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataColumn FileRef = new DataColumn(&quot;FileRef&quot;, typeof(string));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;DataColumn PublishedDate = new DataColumn(&quot;PublishedDate&quot;, typeof(string));&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;dtFinalRecords.Columns.Add(Title);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;dtFinalRecords.Columns.Add(FileRef);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;dtFinalRecords.Columns.Add(PublishedDate);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;try&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (items != null &amp;amp;&amp;amp; items.Rows.Count &amp;gt; 0)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;foreach (DataRow row in items.Rows)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;DataRow rowFinal = dtFinalRecords.NewRow();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;Title&quot;] = row[&quot;Title&quot;];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;FileRef&quot;] = row[&quot;FileRef&quot;];&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;rowFinal[&quot;PublishedDate&quot;] = Convert.ToDateTime(row[&quot;PublishedDate&quot;]).ToString(&quot;dddd, d MMM yyyy hh:mm:ss&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;dtFinalRecords.Rows.Add(rowFinal);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;catch { }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return dtFinalRecords;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public static SPListItemCollection GetTheRssRecords(SPList list)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SPQuery query = new SPQuery();&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SPListItemCollection results = null;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;string strQuery = string.Empty;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;strQuery = @&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;&amp;lt;Where&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;&amp;lt;Or&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&amp;lt;Eq&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;&amp;lt;FieldRef Name=&#39;ContentType&#39; /&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;&amp;lt;Value Type=&#39;Text&#39;&amp;gt;Sharepoint News Page&amp;lt;/Value&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&amp;lt;/Eq&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&amp;lt;Eq&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;&amp;lt;FieldRef Name=&#39;ContentType&#39; /&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;&amp;lt;Value Type=&#39;Text&#39;&amp;gt;Sharepoint Article Page&amp;lt;/Value&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;&amp;lt;/Eq&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;&amp;lt;/Or&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;&amp;lt;/Where&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;&quot;;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;query.Query = strQuery;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;results = list.GetItems(query);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;return results;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
/*******************************************************************************************************************************/&lt;br /&gt;
&lt;br /&gt;
- Now put this aspx page to &quot;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS&quot;&lt;br /&gt;
&lt;br /&gt;
- Now use our custom application page to rendered the RSS feeds.&lt;br /&gt;
&amp;nbsp; i.e. http://YourServer:Port/NewsSite/_layouts/SharepointCustomRSSFeeds.aspx?List=%7BA5EEB0B7%2DA64E%2D40F6%2D9F8D%2D319B3A86A337%7D&lt;br /&gt;
&lt;br /&gt;
- You can get the list id from the address bar by go to the list settings page.&lt;br /&gt;
&amp;nbsp; Here we have not created any list view therefore the Query string parameter &quot;View&quot; will be null.&lt;br /&gt;
&lt;br /&gt;
- Now paste the http://YourServer:Port/NewsSite/_layouts/SharepointCustomRSSFeeds.aspx?List=%7BA5EEB0B7%2DA64E%2D40F6%2D9F8D%2D319B3A86A337%7D url to the address bar,&lt;br /&gt;
&amp;nbsp; Our custom application page will render the rss feed.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Regards&lt;br /&gt;
&amp;nbsp;Hiren Patel&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/2774885981378698364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/custom-application-page-for-sharepoint.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2774885981378698364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2774885981378698364'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/custom-application-page-for-sharepoint.html' title='Custom application page for the sharepoint RSS feeds.'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-5373288299458832269</id><published>2012-07-05T02:07:00.002-07:00</published><updated>2014-04-10T22:45:58.189-07:00</updated><title type='text'>Upgrade the SharePoint solution using PowerShell.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Hello today we will write the powershell script to upgrade the existing wsp to the sharepoint solution store.&lt;br /&gt;
&lt;br /&gt;
1. Open any text editor.&lt;br /&gt;
&lt;br /&gt;
2. Copy the below lines of script code inside it and save the file as like &quot;Upgrade.ps1&quot;.&lt;br /&gt;
&lt;br /&gt;
#************************************************************************************************************************&lt;br /&gt;
Write-Host &#39;&#39;&lt;br /&gt;
Write-Host &#39;Legal Intelligence deployment upgradation started.....&#39; -foregroundcolor Cyan&lt;br /&gt;
&lt;br /&gt;
# Ensure SharePoint cmdlets are loaded :&lt;br /&gt;
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq &#39;Microsoft.SharePoint.Powershell&#39;}&lt;br /&gt;
if ($snapin -eq $null) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Add-PsSnapin Microsoft.SharePoint.PowerShell&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Variables&lt;br /&gt;
$solutionNameCollection = @(&quot;Sharepointcustom.wsp&quot;)&lt;br /&gt;
$CurrentDir=&quot;D:\Solution Package&quot;&lt;br /&gt;
&lt;br /&gt;
# Upgrading the solution one by one&lt;br /&gt;
foreach ($solutionName in $solutionNameCollection)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;Starting upgradation of&#39; $solutionName &#39;solution......&#39; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$SolutionPath=$CurrentDir + &quot;\&quot; + $solutionName&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Update-SPSolution -Identity $solutionName -LiteralPath $SolutionPath -GACDeployment -Local&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &amp;nbsp;&#39;Completed upgradation of&#39; $solutionName &#39;solution......&#39; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Write-Host &#39;Upgradation completed.......&#39; -foregroundcolor Cyan&lt;br /&gt;
Write-Host &#39;&#39;&lt;br /&gt;
Write-Host &quot;Resetting IIS to clear application pools&quot; -foregroundcolor Cyan&lt;br /&gt;
IISRESET&lt;br /&gt;
#************************************************************************************************************************&lt;br /&gt;
&lt;br /&gt;
3. You need to change the current directory path of the wsp inside the script .For that find the &quot;$CurrentDir&quot; and replace it with your existing wsp path.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;i.e. if you existing wsp is located to &quot;D:\Solution Package&quot; then value of the $CurrentDir is&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$CurrentDir=&quot;D:\Solution Package&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
4. Once the solution path will modified then change name of your wsp package.For that find the $solutionNameCollection value and replace it with your existing wsp name.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;i.e.if your wsp name is like &quot;Sharepointcustom.wsp&quot; then the value of $solutionNameCollection is&lt;br /&gt;
&amp;nbsp; &amp;nbsp;$solutionNameCollection = @(&quot;Sharepointcustom.wsp&quot;)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Note: if tou want to install the multiple wsp to the sharepoint solution store then seperate the wsp with comaa(,)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; i.e. $solutionNameCollection = @(&quot;Sharepointcustom1.wsp&quot;,&quot;Sharepointcustom2.wsp&quot;,&quot;Sharepointcustom3.wsp&quot;)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; &amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
5. Save all the changes and open the &quot;SharePoint Management Shell&quot; &amp;nbsp;as an administrator mode from&lt;br /&gt;
&amp;nbsp; &amp;nbsp;All Program -&amp;gt; Microsoft Sharepoint 2010 Products -&amp;gt; SharePoint Management Shell&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
6. Change the direcory path with the existing wsp path that you have already set the value of $CurrentDir=&quot;D:\Solution Package&quot; in the script.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;From the powershell command propmt type the following command&amp;nbsp;&lt;span style=&quot;background-color: black; color: white;&quot;&gt;and press enter button.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;cd &quot;D:\Solution Package&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
7. Now type the following command and press enter.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;.\Upgrade.ps1&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
8. Likewise powershell script is used to upgrade the single or multiple wsp packages to the sharepoint solution store&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Hiren Patel&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/5373288299458832269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/upgrade-sharepoint-solution-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/5373288299458832269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/5373288299458832269'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/upgrade-sharepoint-solution-using.html' title='Upgrade the SharePoint solution using PowerShell.'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-2685105462165093343</id><published>2012-07-05T01:54:00.001-07:00</published><updated>2014-04-10T22:50:17.301-07:00</updated><title type='text'>Install the SharePoint solution using PowerShell.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Hello today we will write the powershell script to install the wsp to the sharepoint solution store.&lt;br /&gt;
&lt;br /&gt;
1. Open any text editor.&lt;br /&gt;
&lt;br /&gt;
2. Copy the below lines of script code inside it and save the file as like &quot;Install.ps1&quot;.&lt;br /&gt;
&lt;br /&gt;
#********************************************************************************&lt;br /&gt;
Write-Host &#39;&#39;&lt;br /&gt;
Write-Host &#39;Checking whether the required services are running...&#39; -foregroundcolor Yellow&lt;br /&gt;
#Start necessary services&lt;br /&gt;
#Start service of World Wide Web&lt;br /&gt;
$WorldWideWebService = Get-Service -Name W3SVC&lt;br /&gt;
if ($WorldWideWebService.Status -ne &quot;Running&quot;)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#Start-SPAdminJob&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &amp;nbsp;&#39;Starting &amp;nbsp;World Wide Web Service ....&#39; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Start-Service W3SVC&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#Start service of Sharepoint admin&lt;br /&gt;
$adminService = Get-Service -Name SPAdminV4&lt;br /&gt;
if ($adminService.Status -ne &quot;Running&quot;)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#Start-SPAdminJob&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &amp;nbsp;&#39;Starting &amp;nbsp;SharePoint 2010 Administration Service ....&#39; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Start-Service SPAdminV4&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#Start service of Sharepoint Timer&lt;br /&gt;
$timerService = Get-Service -Name SPTimerV4&lt;br /&gt;
if ($timerService.Status -ne &quot;Running&quot;)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#Start-SPTimerV4&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &amp;nbsp;&#39;Starting &amp;nbsp;SharePoint 2010 Timer Service ....&#39; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Start-Service SPTimerV4&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Ensure SharePoint cmdlets are loaded :&lt;br /&gt;
$snapin = Get-PSSnapin | Where-Object {$_.Name -eq &#39;Microsoft.SharePoint.Powershell&#39;}&lt;br /&gt;
if ($snapin -eq $null) {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Add-PsSnapin Microsoft.SharePoint.PowerShell&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Variables&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$CurrentDir= &quot;D:\Solution Package&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$solutionNameCollection = @(&quot;Sharepointcustom.wsp&quot;)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$SiteUrl=&quot;http://server:port&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
# Foreach loop to add and deploy the multiple solution to the solution store.&lt;br /&gt;
foreach ($solutionName in $solutionNameCollection)&lt;br /&gt;
{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$SolutionPath=$CurrentDir + &quot;\&quot;+$solutionName&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;function WaitForJobToFinish([string]$SolutionFileName)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$JobName = &quot;*solution-deployment*$SolutionFileName*&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$job = Get-SPTimerJob | ?{ $_.Name -like $JobName }&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if ($job -eq $null)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host &#39;Timer job not found&#39; -foregroundcolor Red&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;else&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;$JobFullName = $job.Name&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host -NoNewLine &#39;Waiting to finish &quot;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host -NoNewLine $JobFullName -foregroundcolor Green&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host -NoNewLine &#39;&quot; job &#39; -foregroundcolor DarkGray&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;while ((Get-SPTimerJob $JobFullName) -ne $null)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Write-Host -NoNewLine . -foregroundcolor DarkGray&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Start-Sleep -Seconds 2&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host -NoNewLine &#39; Done&#39; &amp;nbsp;-foregroundcolor Green&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;Checking whether the solution exists in the Solutions Store.&#39; -foregroundcolor Yellow&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$solution = Get-SPSolution $solutionName -ErrorAction:SilentlyContinue&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if ($solution -ne $null)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Write-Host $solutionName &#39;Already exists&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Write-Host &#39;Checking if&#39; $solutionName &#39;is already deployed&#39; -foregroundcolor Yellow&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# Check whether the solution is already deployed.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if ($solution.Deployed) &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host $solutionName &quot;is already deployed&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host &#39;&#39;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host &quot;Uninstalling &quot; $solutionName -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if ($solution.ContainsWebApplicationResource)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Write-Host &quot;Retracting&quot; $solutionName &quot; from all web applications&quot; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Uninstall-SPSolution -identity $solutionName -allwebapplication -confirm:$false&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;else {&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Write-Host &quot;Retracting&quot; $solutionName -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Uninstall-SPSolution -identity $solutionName -confirm:$false&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;#Write-Host &#39;Waiting for job to finish&#39; -foregroundcolor DarkGray&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;WaitForJobToFinish $solutionName&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;# Remove solution from store.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Write-Host &#39;Removing &#39; $solutionName -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Remove-SPSolution -identity $solutionName -confirm:$false -Force:$true&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;# Add solution to Solutions Store. :&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &quot;Adding&quot; $solutionName &quot; to the Solutions Store&quot; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Add-SPSolution -LiteralPath $solutionPath&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#Add-SPSolution $SolutionPath&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &quot;Deploying&quot; $solutionName -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;# Can use -CASPolicies also here&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;# Not to use -AllWebApplications option.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;# If the solution contains Web Application Resource, use this command.&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Install-SPSolution –Identity $solutionName -WebApplication $SiteUrl –GACDeployment -Force:$true&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#Note: If you want to install the wsp globally then replace the above line with below&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;#Install-SPSolution –Identity $solutionName –GACDeployment -Force:$true&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;WaitForJobToFinish $solutionName&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;Done Deploying Solutions&#39; -foregroundcolor Green&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &#39;&#39;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Write-Host &quot;Resetting IIS to clear application pools&quot; -foregroundcolor Cyan&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;iisreset /noforce&lt;br /&gt;
#********************************************************************************&lt;br /&gt;
&lt;br /&gt;
3. You need to change the current directory path of the wsp inside the script .For that find the &quot;$CurrentDir&quot; and replace it with your existing wsp path.&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;i.e. if you existing wsp is located to &quot;D:\Solution Package&quot; then value of the $CurrentDir is&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$CurrentDir=&quot;D:\Solution Package&quot;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
4. Once the solution path will modified then change name of your wsp package.For that find the $solutionNameCollection value and replace it with your existing wsp name.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;i.e.if your wsp name is like &quot;Sharepointcustom.wsp&quot; then the value of $solutionNameCollection is&lt;br /&gt;
&amp;nbsp; &amp;nbsp;$solutionNameCollection = @(&quot;Sharepointcustom.wsp&quot;)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Note: if tou want to install the multiple wsp to the sharepoint solution store then seperate the wsp with comaa(,)&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt; i.e. $solutionNameCollection = @(&quot;Sharepointcustom1.wsp&quot;,&quot;Sharepointcustom2.wsp&quot;,&quot;Sharepointcustom3.wsp&quot;)&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
5. Now the time is to change your sharepoint WebApplication url on which you want to install the wsp.For that&lt;br /&gt;
&amp;nbsp; &amp;nbsp;find the $SiteUrl and replace its value with your webapplication url.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;$SiteUrl=&quot;http://server:port&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
6. Install-SPSolution –Identity $solutionName -WebApplication $SiteUrl –GACDeployment -Force:$true&lt;br /&gt;
&amp;nbsp; &amp;nbsp;This line will deploy the wsp on specific web application.If you want to deploy the wsp Globally then folowing command will use.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Install-SPSolution –Identity $solutionName –GACDeployment -Force:$true&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
7. Save all the changes and open the &quot;SharePoint Management Shell&quot; &amp;nbsp;as an administrator mode from&lt;br /&gt;
&amp;nbsp; &amp;nbsp;All Program -&amp;gt; Microsoft Sharepoint 2010 Products -&amp;gt; SharePoint Management Shell&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
8. Change the direcory path with the existing wsp path that you have already set the value of $CurrentDir=&quot;D:\Solution Package&quot; in the script.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;From the powershell command propmt type the following command&amp;nbsp;&lt;span style=&quot;background-color: black; color: white;&quot;&gt;and press enter.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;cd &quot;D:\Solution Package&quot;&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
9. Now type the following command and press enter.&lt;br /&gt;
&amp;nbsp; &amp;nbsp;.\Install.ps1&lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
10.Likewise powershell script is used to install the single or multiple wsp packages to the sharepoint solution store&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Hiren Patel&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/2685105462165093343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/install-sharepoint-solution-using.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2685105462165093343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2685105462165093343'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/install-sharepoint-solution-using.html' title='Install the SharePoint solution using PowerShell.'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-7215636035357240914</id><published>2012-07-05T01:00:00.000-07:00</published><updated>2012-07-05T01:00:21.146-07:00</updated><title type='text'>Rendered SharePoint search result in xml format</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Hello ,&lt;br /&gt;
using below xslt we get the sharepoint 2010 search result in xml format.&lt;br /&gt;
For that ,&lt;br /&gt;
1. Go to the search result page&lt;br /&gt;
2. Edit the page and Edit the core search result webpart property.&lt;br /&gt;
3. Go to the xslt section and first create the backup of the existing xslt for the search result and replace it wil below xslt&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; indent=&quot;yes&quot;/&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;xsl:template match=&quot;/&quot;&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;xmp&amp;gt;&amp;lt;xsl:copy-of select=&quot;*&quot;/&amp;gt;&amp;lt;/xmp&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/xsl:template&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;br /&gt;
4. Click ok and save and publish the page&lt;br /&gt;
5. Perform search again it will rendered the search result in xml format.&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Hiren Patel&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/7215636035357240914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/rendered-sharepoint-search-result-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/7215636035357240914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/7215636035357240914'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/rendered-sharepoint-search-result-in.html' title='Rendered SharePoint search result in xml format'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-3747330646468735786</id><published>2012-07-04T23:52:00.002-07:00</published><updated>2012-07-04T23:52:57.243-07:00</updated><title type='text'>Create pages programatically in SharePoint 2010</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hello,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;- In this post we will get specified the content types in the sites and using that content type we will create the page programatically&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;- Using window application we will do this stuff.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;- So first create the window application and add the Microsoft.Sharepoint.dll reference from the 14 hives directory.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;-Now put some control as shown below and also give the appropriate name already mention below.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim3CD5CROaDKsihPwCg_C3Phbjb3FfYNE-W67nEkYdytnJPKHpak1sKmfJV3bq7ILm1oeLA_qy9iyZFKAI1VMO-8rk9RNHfvWaBwN8AeqsXKsM1aH81R_OteGedQm51LaTAhAciwDrfRzz/s1600/Programatically+create+the+page.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;434&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim3CD5CROaDKsihPwCg_C3Phbjb3FfYNE-W67nEkYdytnJPKHpak1sKmfJV3bq7ILm1oeLA_qy9iyZFKAI1VMO-8rk9RNHfvWaBwN8AeqsXKsM1aH81R_OteGedQm51LaTAhAciwDrfRzz/s640/Programatically+create+the+page.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now add the following lines of code insite the button click event and also add the custon methods.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;//This function will use to get the specified content type and add those to the combo box&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private void btnContentType_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;using (SPSite site = new SPSite(txtURL.Text))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;using (SPWeb web = site.OpenWeb())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;PublishingSite pSite = new PublishingSite(site);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SPContentType ctype = pSite.ContentTypes[comboBoxContentType.SelectedText];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;foreach (PageLayout p in pSite.PageLayouts)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (p.AssociatedContentType.ResourceFolder.Name.ToLower() == &quot;Custom content type 1&quot;.Trim().ToLower() &amp;amp;&amp;amp; p.Name.ToLower() == &quot;CustomPageLayouts1.aspx&quot;.ToLower())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;comboBoxContentType.Items.Add(p.AssociatedContentType.ResourceFolder.Name);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;else if (p.AssociatedContentType.ResourceFolder.Name.ToLower() == &quot;Custom content type 2&quot;.Trim().ToLower() &amp;amp;&amp;amp; p.Name.ToLower() == &quot;CustomPageLayouts2.aspx&quot;.ToLower())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;comboBoxContentType.Items.Add(p.AssociatedContentType.ResourceFolder.Name);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;//Add the following line of code to the selected index change event of the combo box&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private void comboBoxContentType_SelectedIndexChanged(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (pageLayoutForCreatingThePage != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;lblPageLayouts.Text = pageLayoutForCreatingThePage.Name;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;//Add following line of code to the button click event of the Create button , this code will useful to create the pages&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private void btnCreate_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;using (SPSite site = new SPSite(txtURL.Text))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;using (SPWeb web = site.OpenWeb())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;PublishingSite pSite = new PublishingSite(site);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;PageLayout pageLayout = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;foreach (PageLayout p in pSite.PageLayouts)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;if (comboBoxContentType.SelectedItem.ToString().ToLower() == &quot;Custom content type 1&quot;.Trim().ToLower() &amp;amp;&amp;amp; p.AssociatedContentType.ResourceFolder.Name.ToLower() == &quot;Custom content type 1&quot;.Trim().ToLower() &amp;amp;&amp;amp; p.Name.ToLower() == &quot;CustomPageLayouts1.aspx&quot;.ToLower())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;pageLayout = p;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;else if (comboBoxContentType.SelectedItem.ToString().ToLower() == &quot;Custom content type 2&quot;.Trim().ToLower() &amp;amp;&amp;amp; p.AssociatedContentType.ResourceFolder.Name.ToLower() == &quot;Custom content type 2&quot;.Trim().ToLower() &amp;amp;&amp;amp; p.Name.ToLower() == &quot;CustomPageLayouts2.aspx&quot;.ToLower())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;pageLayout = p;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;break;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;pageLayoutForCreatingThePage = pageLayout;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(web);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;PublishingPageCollection pPages = pWeb.GetPublishingPages();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SPList list = pPages.PubWeb.PagesList;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SPQuery query = null;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;string pageName = string.Empty;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;string strQuery = string.Empty;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Hashtable hs = new Hashtable();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;strQuery = @&quot;&amp;lt;FieldRef Name=&#39;Title&#39; /&amp;gt;&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;strQuery = string.Format(strQuery, pageName);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;query = new SPQuery();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;query.Query = strQuery;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (list.GetItems(query).Count &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;DataTable dt = list.GetItems(query).GetDataTable();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;foreach (DataRow row in dt.Rows)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;hs.Add(row[&quot;Title&quot;].ToString().ToLower(), row[&quot;Title&quot;].ToString().ToLower());&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;for (int i = 0; i &amp;lt; Convert.ToInt32(textBoxPagesToCreate.Text); i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;pageName = comboBoxContentType.SelectedItem.ToString().Trim().Replace(&quot; &quot;, &quot;-&quot;) + &quot;-&quot; + System.DateTime.Now.AddDays(i + 1).AddHours(i + 1).ToShortDateString().Replace(&quot;/&quot;, &quot;_&quot;).ToString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;if (!hs.ContainsKey(pageName.ToLower()))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;string filename = comboBoxContentType.SelectedItem.ToString().Trim().Replace(&quot; &quot;, &quot;-&quot;) + &quot;-&quot; + System.DateTime.Now.AddDays(i + 1).AddHours(i + 1).ToShortDateString().Replace(&quot;/&quot;, &quot;_&quot;).ToString() + &quot;.aspx&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;PublishingPage pPage = pPages.Add(filename, pageLayout);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;SPListItem newpage = pPage.ListItem;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;//Here we are setting the &quot;Title&quot; field property of the page&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;newpage[&quot;Title&quot;] = comboBoxContentType.SelectedItem.ToString().Trim().Replace(&quot; &quot;, &quot;-&quot;) + &quot;-&quot; + System.DateTime.Now.AddDays(i + 1).AddHours(i + 1).ToShortDateString().Replace(&quot;/&quot;, &quot;_&quot;).ToString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;if (pageLayout.AssociatedContentType.ResourceFolder.Name.ToLower() == &quot;Custom content type 1&quot;.Trim().ToLower())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;//Here we are setting the &quot;PublishStartDate&quot; field property of the page&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;newpage[&quot;PublishStartDate&quot;] = System.DateTime.Now.AddDays(i + 1).AddHours(i + 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;else if (pageLayout.AssociatedContentType.ResourceFolder.Name.ToLower() == &quot;Custom content type 2&quot;.Trim().ToLower())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;//Here we are setting the &quot;ReleasePublihshedDate&quot; field property of the page&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;newpage[&quot;ReleasePublihshedDate&quot;] = System.DateTime.Now.AddDays(i + 1).AddHours(i + 1);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;newpage.Update();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;newpage.File.CheckIn(&quot;Checked in&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;newpage.File.Publish(&quot;published&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;throw ex;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MessageBox.Show(&quot;Operation Completed......&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1. Once the code is added , run the window application ,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2. First add the Site Url of you Site , second click on get content type button ( This will fetch the specified content type form the site)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;3. Second select the desired content type from the combo box and insert the number of amount of page to create.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;4. Third click on the Create button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;5. So it will create the number of pages that you specified using the selected content type.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/3747330646468735786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/create-pages-programatically-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/3747330646468735786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/3747330646468735786'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/create-pages-programatically-in.html' title='Create pages programatically in SharePoint 2010'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim3CD5CROaDKsihPwCg_C3Phbjb3FfYNE-W67nEkYdytnJPKHpak1sKmfJV3bq7ILm1oeLA_qy9iyZFKAI1VMO-8rk9RNHfvWaBwN8AeqsXKsM1aH81R_OteGedQm51LaTAhAciwDrfRzz/s72-c/Programatically+create+the+page.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-1730130929424607370</id><published>2012-07-04T23:04:00.001-07:00</published><updated>2012-07-04T23:04:59.358-07:00</updated><title type='text'>Add Sitetemplate progrmatically in SharePoint 2010</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hello,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Today we will add the site template programatically in sharepoint site to each and every subsites.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;We will create the window application for that.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Next steps is to add the Microsoft.SharePoint.dll form the 14 hives&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now put one lable from the toolbox section and set the text property as &quot;Site Url&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now put one text box beside of label and name it as txtSiteUrl.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now add one button and named it as btnStart and set the text property as &quot;Start&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;so Final look of the window form is like&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSXQtZFKOr-0En7v2BAr3aMWeyALH7f23Tfve_6KC8UoMlfWtbsImJFEP7cVxozf2IJAE1A4Xfgu6kTCJ6vt6U8w3qAW4I_Ozk2aaEFA6PHJ5gvq5fuIYZA12k1fQlxuEq_89zqGMbe7bG/s1600/Add+site+template.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSXQtZFKOr-0En7v2BAr3aMWeyALH7f23Tfve_6KC8UoMlfWtbsImJFEP7cVxozf2IJAE1A4Xfgu6kTCJ6vt6U8w3qAW4I_Ozk2aaEFA6PHJ5gvq5fuIYZA12k1fQlxuEq_89zqGMbe7bG/s640/Add+site+template.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;now add following lines of code to the button click event&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private void btnStart_Click(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;using(SPSite site = new SPSite(txtSiteUrl.Text))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SPWeb rootWeb = site.RootWeb;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ConfigureSiteTemplate(site, rootWeb);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;MessageBox.Show(&quot;Operation Completed Successfully........&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;throw ex;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Below are the custom functions&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;private void ConfigureSiteTemplate(SPSite site, SPWeb web)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;using (SPSite CurrentSite = new SPSite(web.Url))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;using (SPWeb CurrentWeb = CurrentSite.OpenWeb())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SetSiteTemplate(CurrentWeb);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;foreach (SPWeb currentWebSite in CurrentWeb.Webs)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;ConfigureSiteTemplate(site, currentWebSite);//we are calling recursive function for each and every sub site&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;throw ex;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;public void SetSiteTemplate(SPWeb currentWeb)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;bool SharePointCutomTemplateAvailable = false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;Collection&amp;lt;SPWebTemplate&amp;gt; Collection = new Collection&amp;lt;SPWebTemplate&amp;gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;using (SPWeb curWeb = currentWeb)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;using (SPSite curSite = curWeb.Site)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SPWebTemplateCollection TemplateCollection = curWeb.GetAvailableWebTemplates(curWeb.Language);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;foreach (SPWebTemplate Template in TemplateCollection)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;if (Template.Title == &quot;Custom Sharepoint Template&quot;)//This is custom sharepoint template&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;SharePointCutomTemplateAvailable = true;//Here we are checking that the custom template with name &quot;Custom Sharepoint Template&quot; is already added or not&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;if (Template.Name != &quot;ENTERWIKI#0&quot;)//we are adding wiki template&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;Collection.Add(Template);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;foreach (SPWebTemplate template in curSite.GetWebTemplates(curWeb.Language))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;if (!SharePointCutomTemplateAvailable &amp;amp;&amp;amp; template.Title == &quot;Custom Sharepoint Template&quot;)//If the custom template is not available we will add it&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;Collection.Add(template);//Here custom template is added&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;curWeb.SetAvailableCrossLanguageWebTemplates(Collection);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;curWeb.Update();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;throw ex;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now run the application , and give the site url ( &lt;b&gt;http://server:port&lt;/b&gt; ) of you sharepoint site and click on the button , it will add the given site template to your sharepoint sites and subsites.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/1730130929424607370/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/add-sitetemplate-progrmatically-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/1730130929424607370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/1730130929424607370'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/add-sitetemplate-progrmatically-in.html' title='Add Sitetemplate progrmatically in SharePoint 2010'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSXQtZFKOr-0En7v2BAr3aMWeyALH7f23Tfve_6KC8UoMlfWtbsImJFEP7cVxozf2IJAE1A4Xfgu6kTCJ6vt6U8w3qAW4I_Ozk2aaEFA6PHJ5gvq5fuIYZA12k1fQlxuEq_89zqGMbe7bG/s72-c/Add+site+template.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-9169092286313986265</id><published>2012-07-04T06:36:00.005-07:00</published><updated>2012-07-04T06:38:28.391-07:00</updated><title type='text'>Site template not found in sharepoint 2010</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: black; color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Hello,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;When we are creating site using custom template using webtemp.xml file you will get the error like&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Site template not found.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;This is because of the same template id in the different webtemp.xml file under the specified culture folder.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;e.g. for english &quot;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\1033\XML&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;Templates xmlns:ows=&quot;Microsoft SharePoint&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;!--Provision for Global site--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;Template Name=&quot;SharepointCustomGlobal&quot; ID=&quot;10051&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;Configuration ID=&quot;0&quot; Title=&quot;SharepointCustom content management host site&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Hidden=&quot;FALSE&quot; ImageUrl=&quot;/_layouts/1033/images/IPPT.gif&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Description=&quot;A SharepointCustom site.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ProvisionAssembly=&quot;Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ProvisionClass=&quot;Microsoft.SharePoint.Publishing.PortalProvisioningProvider&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ProvisionData=&quot;xml\\SharepointCustomGlobalPortal.xml&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;RootWebOnly=&quot;TRUE&quot; DisplayCategory=&quot;SharepointCustom&quot; VisibilityFeatureDependency=&quot;97A2485F-EF4B-401f-9167-FA4FE177C6F6&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/Configuration&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/Template&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/Templates&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;So to resolve this error you need to change the Template ID of your existing webtemp.xml file&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;So &amp;nbsp;suppose previously it was like 10051 so change it some what else not used by any one like 20050 something..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;so modified webtemp.xml with new id id like&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;Templates xmlns:ows=&quot;Microsoft SharePoint&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;!--Provision for Global site--&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;Template Name=&quot;SharepointCustomGlobal&quot; ID=&quot;10051&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;Configuration ID=&quot;0&quot; Title=&quot;SharepointCustom content management host site&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Hidden=&quot;FALSE&quot; ImageUrl=&quot;/_layouts/1033/images/IPPT.gif&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;Description=&quot;A SharepointCustom site.&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ProvisionAssembly=&quot;Microsoft.SharePoint.Publishing, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ProvisionClass=&quot;Microsoft.SharePoint.Publishing.PortalProvisioningProvider&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;ProvisionData=&quot;xml\\SharepointCustomGlobalPortal.xml&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;RootWebOnly=&quot;TRUE&quot; DisplayCategory=&quot;SharepointCustom&quot; VisibilityFeatureDependency=&quot;97A2485F-EF4B-401f-9167-FA4FE177C6F6&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;/Configuration&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/Template&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/Templates&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/9169092286313986265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/site-template-not-found-in-sharepoint.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/9169092286313986265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/9169092286313986265'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/site-template-not-found-in-sharepoint.html' title='Site template not found in sharepoint 2010'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-2313627000494566390</id><published>2012-07-04T04:58:00.000-07:00</published><updated>2012-07-04T06:11:11.927-07:00</updated><title type='text'>Attached SharePoint 2010 Master Page using feature receiver</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hello,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In this post i will explain , how to deploy the master page to the SharePoint Master page gallery and melodramatically using feature receiver apply the master page to the Site Collection.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;First create the empty SharePoint project using &amp;nbsp;the visual studio 2010 named it as SharePointCustom&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now add Sharepoint Module element by right click on the Project - &amp;gt; click Add - &amp;gt; New Item -&amp;gt; Select SharePoint 2010 Section - &amp;gt; Select Module element - &amp;gt; &amp;nbsp;Give Proper Name - &amp;gt;Click on Add button&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;I have specified the name like &quot;SharepointCustom.MasterPages&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now add the existing master page ( v4.Master ) to the Module element from the Sharepoint 14 hives Layouts folder&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&quot;C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Rename the master page as &quot;SharepointCustom.master&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Add the same master page to set it as a System master and renamed it as &quot;SharepointCustomsSystem.master&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now open the element.xml file of the master page it will be looked as shown below&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;Elements xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;Module Name=&quot;SharepointCustom.MasterPages&quot; &amp;nbsp;Url=&quot;_catalogs/masterpage&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;File Path=&quot;SharepointCustom.MasterPages\SharepointCustom.master&quot; Url=&quot;SharepointCustom.MasterPages/SharepointCustom.master&quot; Type=&quot;GhostableInLibrary&quot; IgnoreIfAlreadyExists=&quot;True&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;File Path=&quot;SharepointCustom.MasterPages\SharepointCustomSystem.master&quot; Url=&quot;SharepointCustom.MasterPages/SharepointCustomSystem.master&quot; Type=&quot;GhostableInLibrary&quot; IgnoreIfAlreadyExists=&quot;True&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/Module&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/Elements&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;and .spdata file for the master page (by default this file is hidden you can view this file by click on the Show All File option from the solution explorer)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;ProjectItem Type=&quot;Microsoft.VisualStudio.SharePoint.Module&quot; DefaultFile=&quot;Elements.xml&quot; SupportedTrustLevels=&quot;All&quot; SupportedDeploymentScopes=&quot;Web, Site&quot; xmlns=&quot;http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;lt;Files&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ProjectItemFile Source=&quot;Elements.xml&quot; Target=&quot;SharepointCustom.MasterPages\&quot; Type=&quot;ElementManifest&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ProjectItemFile Source=&quot;SharepointCustom.master&quot; Target=&quot;SharepointCustom.MasterPages\&quot; Type=&quot;ElementFile&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;ProjectItemFile Source=&quot;SharepointCustomSystem.master&quot; Target=&quot;SharepointCustom.MasterPages\&quot; Type=&quot;ElementFile&quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;lt;/Files&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/ProjectItem&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Above changes will add the Master Pages to the Master Page Gallery.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now add Site level feature to attached master page with the Site.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Named it as &quot;SharepointCustom.MasterPages&quot; and add event receiver by right click on the feature - &amp;gt; click on the &quot;Add Event Receiver&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we set Activate On Default property is true by double click on the feature , click any where on the feature surface and click on F4 key.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAffl4T_4uUdyyD_PUGrXhP5TCDSU6XV825sn8KXFTDkbT-hwMz20rCNh87hUEKOHv444pj4DfiPQtdk9lHS8BQ1GA__pPPaLRmHf6NukvtJoIHPLCLwlYQq1JFaeINvSxWrf3dK5qdqkg/s1600/MasterPage+feature+property.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAffl4T_4uUdyyD_PUGrXhP5TCDSU6XV825sn8KXFTDkbT-hwMz20rCNh87hUEKOHv444pj4DfiPQtdk9lHS8BQ1GA__pPPaLRmHf6NukvtJoIHPLCLwlYQq1JFaeINvSxWrf3dK5qdqkg/s640/MasterPage+feature+property.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So final structure of the solution is looked like as below&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqR04pbuaWyxQOgCImRhq45nXGfl1qaT7sEyFNCj-K7jAsZF6R4C6O0XPynBpbJbNiDZxOQDqBCQZWkvX1TTYnFEZzxc0_OwSDtyFkevNnT1zeip_1gh92AUK82Zn_a2pE35BCFbZsrRuY/s1600/MasterPageStructure.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqR04pbuaWyxQOgCImRhq45nXGfl1qaT7sEyFNCj-K7jAsZF6R4C6O0XPynBpbJbNiDZxOQDqBCQZWkvX1TTYnFEZzxc0_OwSDtyFkevNnT1zeip_1gh92AUK82Zn_a2pE35BCFbZsrRuY/s1600/MasterPageStructure.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #444444;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;Now open the code behind file for the feature and uncomment the &quot;FeatureActivated&quot; method.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;Add the following lines of code to the method&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;public override void FeatureActivated(SPFeatureReceiverProperties properties)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SPSite currentSite = (SPSite)properties.Feature.Parent;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (currentSite != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SPWeb currentWeb = currentSite.RootWeb;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Uri systemMasterUri = new Uri(currentWeb.Url + &quot;/_catalogs/masterpage/SharepointCustom.MasterPages/SharepointCustomSystem.master&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Uri customMasterUri = new Uri(currentWeb.Url + &quot;/_catalogs/masterpage/SharepointCustom.MasterPages/SharepointCustom.master&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;currentWeb.MasterUrl = customMasterUri.AbsolutePath;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;currentWeb.CustomMasterUrl = systemMasterUri.AbsolutePath;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;currentWeb.Update();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;So when feature get activated at site level our custom master pages will be attached with the site.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;Now add following lines of code to reset the origional master pages when feature will get deactivated&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;public override void FeatureDeactivating(SPFeatureReceiverProperties properties)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;SPSite currentSite = (SPSite)properties.Feature.Parent;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;if (currentSite != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SPWeb currentWeb = currentSite.RootWeb;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Uri masterUri = new Uri(currentWeb.Url + &quot;/_catalogs/masterpage/v4.master&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;currentWeb.MasterUrl = masterUri.AbsolutePath;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;currentWeb.CustomMasterUrl = masterUri.AbsolutePath;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;currentWeb.Update();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;Now deploy the solutions.Our custom feature will activated because we have set &quot;Activate On Default&quot; property is true.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: white; font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/2313627000494566390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/attached-sharepoint-2010-master-page.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2313627000494566390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2313627000494566390'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/attached-sharepoint-2010-master-page.html' title='Attached SharePoint 2010 Master Page using feature receiver'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAffl4T_4uUdyyD_PUGrXhP5TCDSU6XV825sn8KXFTDkbT-hwMz20rCNh87hUEKOHv444pj4DfiPQtdk9lHS8BQ1GA__pPPaLRmHf6NukvtJoIHPLCLwlYQq1JFaeINvSxWrf3dK5qdqkg/s72-c/MasterPage+feature+property.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-875570368290086798</id><published>2012-07-04T03:36:00.002-07:00</published><updated>2012-07-04T03:50:34.835-07:00</updated><title type='text'>Hide the ribbon control for the anonymous user</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hello &amp;nbsp;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Today we will hide the ribbon control for the anonymous users.Generally when we configured the anonymous access in the SharePoint site , the ribbon control is also visible but we do not want to show the same for the anonymous user.so we will use some JavaScript trick and SharePoint permission feature.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;so lets we start.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;First open your master page.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;we will by default hide the ribbon control division tag , so for that find the ribbon control division id &quot;s4-ribbonrow&quot; and make the division to display none by applying the style and add the following tag after completion of the ribbon division element.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;Sharepoint:SPSecurityTrimmedControl ID=&quot;SPSecurityTrimmedControlAnonymousUser&quot; runat=&quot;server&quot; PermissionsString=&quot;AddAndCustomizePages&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; document.getElementById(&quot;s4-ribbonrow&quot;).style.display = &quot;block&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/Sharepoint:SPSecurityTrimmedControl&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;The final tag will be look like as shown below&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;div id=&quot;s4-ribbonrow&quot; class=&quot;s4-pr s4-ribbonrowhidetitle&quot;style=&quot;display:none&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp;Ribbon control content.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;Sharepoint:SPSecurityTrimmedControl ID=&quot;SPSecurityTrimmedControlAnonymousUser&quot; runat=&quot;server&quot; PermissionsString=&quot;AddAndCustomizePages&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp; document.getElementById(&quot;s4-ribbonrow&quot;).style.display = &quot;block&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;/Sharepoint:SPSecurityTrimmedControl&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Here , the user who is having the permission of adding the page and customized the page can only view the ribbon.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Next save the masterpage and published it.so the ribbon will be hide for the anonymous user.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;If you want to display the sign in button for the anonymous user you need to remove the&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;welcome control from the ribbon division to some where else as per your UI requirement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Find the below tag from the ribbon division element and place it to some other location as per your requirement.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;wssuc:Welcome id=&quot;IdWelcome&quot; runat=&quot;server&quot; EnableViewState=&quot;false&quot;&amp;gt;&amp;lt;/wssuc:Welcome&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/875570368290086798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/hide-ribbon-control-for-anonymous-user.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/875570368290086798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/875570368290086798'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/hide-ribbon-control-for-anonymous-user.html' title='Hide the ribbon control for the anonymous user'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-5008684056890336904</id><published>2012-07-04T02:26:00.000-07:00</published><updated>2012-07-04T02:31:17.745-07:00</updated><title type='text'>Create the SharePoint site in different languages using variation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hello,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Today we will learn how to create the sharepoint site in different languages.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Using variation concept in sharepoint we can create sites in different languages without installation of different Sharepoint versions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Variation concept is best suitable for the publishing sites and pages.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So first downloads the desired languages packs from the microsoft sites.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;http://www.microsoft.com/en-us/download/details.aspx?id=3411&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;To check how many language pack is installed at your server have the differnt ways.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;One way is to check the language options by go to your site&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Site Action - &amp;gt;Site Settings -&amp;gt; Go to the Site Collection Administration section -&amp;gt;click on Create Variaion Label&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcP0BxJm3MW6VDVbi-g92GX9Tkcc5Je1Gu6gUwmsMhHDmYMabgpPVZduA9wv3ReWi2Y2eSF8RSZCp93P-jTcuP_u2cDcnCmff-fzXzBfOCrHA96OCyq4i8ogJss_vlcucC-tRYNCU_-HIA/s1600/Variation+links.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcP0BxJm3MW6VDVbi-g92GX9Tkcc5Je1Gu6gUwmsMhHDmYMabgpPVZduA9wv3ReWi2Y2eSF8RSZCp93P-jTcuP_u2cDcnCmff-fzXzBfOCrHA96OCyq4i8ogJss_vlcucC-tRYNCU_-HIA/s320/Variation+links.jpg&quot; width=&quot;291&quot; /&gt;&lt;/a&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;And find the language section as shown below here i have installed total two Finnish and Swedish.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj0wSMy-jHFsfdnctBC51BWvb65CuOopVjdZBWQhkWtLNPJZYR_CGqQCnnDkqgbA1n2XLL9jEWfGTO6LOKn3C3PnENUB-zTlrbg39bzrKNCRsZfeS5_24Hg_UQi1DKjCjsz7xGs00T-17x/s1600/Create+site+in+different+languages+1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img alt=&quot;Language Option&quot; border=&quot;0&quot; height=&quot;201&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj0wSMy-jHFsfdnctBC51BWvb65CuOopVjdZBWQhkWtLNPJZYR_CGqQCnnDkqgbA1n2XLL9jEWfGTO6LOKn3C3PnENUB-zTlrbg39bzrKNCRsZfeS5_24Hg_UQi1DKjCjsz7xGs00T-17x/s640/Create+site+in+different+languages+1.jpg&quot; title=&quot;Language Option&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;when there is no sharepoint language pack installed in the server you cant find the to select the language option inside the SharePoint.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we are going to install the language packs.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Once the language pack is being installed run the Sharepoint 2010 Products Configuration wizards.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Perform the necessary steps from Sharepoint 2010 Products Configuration wizards.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Here I assumed that you have already having the publishing website available.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we are creating the variation sites.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;so for that go to the Site Action - &amp;gt;Site Settings -&amp;gt; Go to the Site Collection Administration section -&amp;gt;click on Variations link as shown first screen shot.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Apply the changes as shown below and then click OK.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC_JzC8YTE-EhWUOGGElRY1bmx6fedmhNiUnrfN7Voeo7FqSBnZL57Y5EpnrAC7dF0Q2Sk6USaQ_HXyXGpXDSdIbyyVFN7yXFMFqcermlG0Ts5vJVkOKfJ9MEK54sJUm_CfHtG_i9AImSC/s1600/Create+site+in+different+languages+Variation+root.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;268&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhC_JzC8YTE-EhWUOGGElRY1bmx6fedmhNiUnrfN7Voeo7FqSBnZL57Y5EpnrAC7dF0Q2Sk6USaQ_HXyXGpXDSdIbyyVFN7yXFMFqcermlG0Ts5vJVkOKfJ9MEK54sJUm_CfHtG_i9AImSC/s640/Create+site+in+different+languages+Variation+root.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So we have done the settings of the top-level Web site of the site collection, by type a slash (/).&lt;/span&gt;&lt;span style=&quot;background-color: black;&quot;&gt;&lt;span style=&quot;color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now the next task is to create the variation label of different sites.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;so for that go to the Site Action -&amp;gt; Site Settings -&amp;gt;Go to the Site Collection&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Administration section - &amp;gt; click on Create Variation Label-&amp;gt;You can give give the appropriate label for the language as seen below&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;table border=&quot;1px solid #EAEAEA&quot; style=&quot;border-collapse: collapse; width: 476px;&quot;&gt;
    &lt;tbody&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;Language Name &lt;/strong&gt;
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;Culture Name &lt;/strong&gt;
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;strong&gt;Locale ID&lt;/strong&gt;
            &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Arabic
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ar-sa
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1025
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Bulgarian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;bg-bg
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1026
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Catalan
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ca-es
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1027
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Chinese (Simplified)
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;zh-cn
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2052
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Chinese (Traditional, Taiwan)
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;zh-tw
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1028
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Croatian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;hr-hr
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1050
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Czech
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;cs-cz
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1029
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Danish
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;da-dk
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1030
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Dutch
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;nl-nl
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1043
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;English
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;en-us
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1033
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Estonian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;et-ee
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1061
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Finnish
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;fi-fi
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1035
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;French
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;fr-fr
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1036
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;German
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;de-de
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1031
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Greek
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;el-gr
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1032
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hebrew
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;he-il
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1037
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hindi
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;hi-in
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1081
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hungarian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;hu-hu
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1038
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Italian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;it-it
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1040
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Japanese
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ja-jp
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1041
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Kazakh
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;kk-kz
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1087
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Korean
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ko-kr
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1042
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Latvian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;lv-lv
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1062
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Lithuanian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;lt-lt
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1063
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Norwegian (Bokmål)
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;nb-no
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1044
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Polish
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;pl-pl
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1045
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Portuguese (Brazil)
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;pt-br
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1046
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Portuguese (Portugal)
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;pt-pt
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2070
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Romanian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ro-ro
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1048
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Russian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ru-ru
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1049
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Serbian (Latin)
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;sr-latn-cs
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2074
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Slovak
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;sk-sk
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1051
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Slovenian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;sl-si
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1060
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Spanish
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;es-es
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;3082
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Swedish
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;sv-se
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1053
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Thai
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;th-th
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1054
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Turkish
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;tr-tr
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1055
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;tr&gt;
            &lt;td width=&quot;262&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Ukrainian
            &lt;/span&gt;&lt;/td&gt;
            &lt;td width=&quot;124&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;uk-ua
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
            &lt;td width=&quot;80&quot;&gt;&lt;div align=&quot;center&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1058
                &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
        &lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;First we are taking english site as a source variation &amp;nbsp;site and creating first label for the english.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now give the appropraite name for the label and apply required settings as shown below.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqBsjJPVKwJ96ks5WSjBGC63x6OXeUP-SOjixGk6tg-eaxeoALImfJ9XriMHsKX80r0yPw5SJ8RsBMhwTC73B9p4ahehCjK-A9XaHuUp_ZLZQSonPQyRRDxTdbwXYdJraFiSEj5qff1wW3/s1600/source+variation.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;296&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqBsjJPVKwJ96ks5WSjBGC63x6OXeUP-SOjixGk6tg-eaxeoALImfJ9XriMHsKX80r0yPw5SJ8RsBMhwTC73B9p4ahehCjK-A9XaHuUp_ZLZQSonPQyRRDxTdbwXYdJraFiSEj5qff1wW3/s640/source+variation.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Click ok &amp;nbsp;, Same way i am creating another label of finnish language.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimi3USaZFRnTru4YtwIyN7MiFtjeiOpSuIykxSPKlmai2_FryHm-rUxcaV8VQOJ-fhF55ZJ3qwbdqH59kXUL44FtY-AF2X9uuucPtSl3QLHMdxMAsJfD5MH2-HNEfPwC5Fllnv-auZnMz7/s1600/finnish+variation.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimi3USaZFRnTru4YtwIyN7MiFtjeiOpSuIykxSPKlmai2_FryHm-rUxcaV8VQOJ-fhF55ZJ3qwbdqH59kXUL44FtY-AF2X9uuucPtSl3QLHMdxMAsJfD5MH2-HNEfPwC5Fllnv-auZnMz7/s640/finnish+variation.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we have created two variation label.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we are creating the variaiton hierarchies so for that go to the Site Action - &amp;gt;Site Settings -&amp;gt; Go to the Site Collection Administration section -&amp;gt;click on Create Variaion Label -&amp;gt;then click on create variation Hierarchy.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9EIKZu7Ksu6iaqtgRajDe_rMrH6gEptzZaD0QtJKV8inJCqz1Ee_dcJNlFXUDmq3wdDV-STXwZ5D5x5_mp2e68cU1IN-XnATGFEbZefDwEPPc5Lj6u8JlaIIo-11Ni3fOpsxi8YfQ3wLD/s1600/create+hierarchies.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;95&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9EIKZu7Ksu6iaqtgRajDe_rMrH6gEptzZaD0QtJKV8inJCqz1Ee_dcJNlFXUDmq3wdDV-STXwZ5D5x5_mp2e68cU1IN-XnATGFEbZefDwEPPc5Lj6u8JlaIIo-11Ni3fOpsxi8YfQ3wLD/s640/create+hierarchies.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So after that the Timer Job will execute to create the hierarchies it will take some times if you want the quicker result then you need to manually execute the timer job.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;For that Go to the central administration site , Select Monitoring from the left panel -&amp;gt; Now select the Review job definitions.You will find the below screen.Now select your web application and click on the below links and run it as now for all the five links.So timer job will execute and it will create the hierarchy.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuR9DQqgE8M8kEht-I5ptq4BAC4JQ0wHW93YPwznJ8Zv7ySOjbgcBKPJbJc2ZkASdqYRwaG8uxkbAI7LeQyJsh7vDFtGfb5qzVPJWKebfYfXDgpKqCKMTtTDhI2-AppTQ0t7n2J08_5DFL/s1600/Timer+job.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;286&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuR9DQqgE8M8kEht-I5ptq4BAC4JQ0wHW93YPwznJ8Zv7ySOjbgcBKPJbJc2ZkASdqYRwaG8uxkbAI7LeQyJsh7vDFtGfb5qzVPJWKebfYfXDgpKqCKMTtTDhI2-AppTQ0t7n2J08_5DFL/s640/Timer+job.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6NZTo9MyeXT2gPPS5HH3F61jQiBTltQS5pArZcCOHtgJMNJmNyrfBit_k5J_CTTLeJrm7xiu6ywfbjFxOurAL0OfPcwaF1y5cwKjWL5BtCU_2x1JoZD1SUW1tk5p7t9Q0Mpgx8jsF7FGM/s1600/Timer+job.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;You can check the whether the variation is successfully created or not using the varation log by go to the&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Site Action - &amp;gt;Site Settings -&amp;gt; Go to the Site Collection Administration section -&amp;gt; Click on the &amp;nbsp;Variation Log&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnLCN7JQUqM0GM1wQv4QRmM8_KqIjYBFGHI_xKyFCBkd0JH9agt5Q8tqJdDH0J9vkPOh8js-pzuZ5X0FSQ4tvG7t6VSuG8OCQUBcjmjqX2sjJTpKul8lEGj4NvzdSAm1J_O7aHtsUI7cke/s1600/Hierarchy+created.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;130&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnLCN7JQUqM0GM1wQv4QRmM8_KqIjYBFGHI_xKyFCBkd0JH9agt5Q8tqJdDH0J9vkPOh8js-pzuZ5X0FSQ4tvG7t6VSuG8OCQUBcjmjqX2sjJTpKul8lEGj4NvzdSAm1J_O7aHtsUI7cke/s640/Hierarchy+created.jpg&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Once the staus is successfully created the hierarchy you can find the both the variation sites en-us and fi-fi&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/5008684056890336904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/create-sharepoint-site-in-different.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/5008684056890336904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/5008684056890336904'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/create-sharepoint-site-in-different.html' title='Create the SharePoint site in different languages using variation'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcP0BxJm3MW6VDVbi-g92GX9Tkcc5Je1Gu6gUwmsMhHDmYMabgpPVZduA9wv3ReWi2Y2eSF8RSZCp93P-jTcuP_u2cDcnCmff-fzXzBfOCrHA96OCyq4i8ogJss_vlcucC-tRYNCU_-HIA/s72-c/Variation+links.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-2770911955142638896</id><published>2012-07-03T03:16:00.000-07:00</published><updated>2012-07-04T02:50:48.508-07:00</updated><title type='text'>Modify the table of content webpart property programatically in sharepoint</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;In this post i mentioned how to access the Table of content webpart progrmatically and how to modify its property.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;So for that first open the visual studio 2010.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Then create one Empty sharepoint project.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;specify your site url on which the solution need to deploy.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Then add sharepoint map folder by right click on the project and click on Add -&amp;gt; Sharepoint Mapped Folder - &amp;gt; Select Template - &amp;gt; ControlTemplate - Click OK .&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Add one &amp;nbsp;empty folder and named it as TOCWebpart inside the ControlTemplate folder.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: black; color: white; font-family: Verdana, sans-serif;&quot;&gt;Add user control inside the TOCWebpart folder.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Below is my user control code.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using System;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using System.Web.UI;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using System.Web.UI.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using System.Web.UI.WebControls.WebParts;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using Microsoft.SharePoint;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using Microsoft.SharePoint.WebPartPages;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using Microsoft.SharePoint.Publishing.WebControls;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;using SharePoint.CMS.Common;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;namespace SharePoint.CMS.SP.UserControls&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public partial class TOCWebpartModification : UserControl&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;protected void Page_Load(object sender, EventArgs e)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (SPContext.Current.ListItem != null &amp;amp;&amp;amp; SPContext.Current.ListItem.File != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;SPFile page = SPContext.Current.ListItem.File;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;if (page.Level == SPFileLevel.Checkout &amp;amp;&amp;amp; (page.Item.ContentType.Name == &quot;SharePoint News Page&quot;))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;bool allowUnSafeUpdates = SPContext.Current.Web.AllowUnsafeUpdates;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;SPContext.Current.Web.AllowUnsafeUpdates = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;using (SPLimitedWebPartManager wpm = page.GetLimitedWebPartManager(PersonalizationScope.Shared))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;string webpartZoneID = &quot;TOCWebpartZoneID&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;for (int i = 0; i &amp;lt; wpm.WebParts.Count; i++)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;          &lt;/span&gt;if (wpm.GetZoneID(wpm.WebParts[i]) == webpartZoneID)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;          &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;TableOfContentsWebPart tocWP = wpm.WebParts[i].WebBrowsableObject as TableOfContentsWebPart;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;string tocTitle = Convert.ToString(tocWP.Title).ToLower();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;tocWP.LevelsToShow = 2;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;tocWP.IncludeContentFromStartingLocation = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;tocWP.AnchorLocation = Convert.ToString(Helper.GetResourceStringForCulture(SPContext.Current.Web.Locale, &quot;AboutSharePoint_Site__RelativeURL&quot;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;wpm.MoveWebPart(tocWP, webpartZoneID, 0);//This line will change the webpart zone index to zero&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;wpm.SaveChanges(wpm.WebParts[i]);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;           &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;          &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;          &lt;/span&gt;Logger.Log(ex);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;finally&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;         &lt;/span&gt;wpm.Web.Dispose();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;       &lt;/span&gt;SPContext.Current.Web.AllowUnsafeUpdates = allowUnSafeUpdates;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;      &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;catch (Exception ex)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;Logger.Log(ex);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;});&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Deploy the solution.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now we are going to add this user control reference to the page to use this webpart.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;%@ Register TagPrefix=&quot;TOC&quot; TagName=&quot;SharepointTOC&quot; Src=&quot;~/_controltemplates/TOCWebpart/TOCWebpartModification.ascx&quot; %&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now put this usercontrol &amp;nbsp;reference to the page by using&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;lt;TOC:SharepointTOC ID=&quot;ucSharepointTOC&quot; runat=&quot;server&quot; &amp;gt;&amp;lt;/TOC:SharepointTOC&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/2770911955142638896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/modify-table-of-content-webpart.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2770911955142638896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2770911955142638896'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/modify-table-of-content-webpart.html' title='Modify the table of content webpart property programatically in sharepoint'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-7633845814160689992</id><published>2012-07-03T02:34:00.002-07:00</published><updated>2012-07-04T02:51:01.672-07:00</updated><title type='text'>Access the sharepoint master page gallery programatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Today we will access the Sharepoint Masterpage Gallery and delete the existing&amp;nbsp;sub-folder.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So first create one window console application using visual studio 2010.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Then add the Microsoft.Sharepoint.dll reference from the ISAPI folder from 14 hive directory( &quot;C:\Program&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI&quot;).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So below are my source code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;namespace DeleteFolderFromMasterPageGallery&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;class Program&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;Program obj = new Program();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;obj.GetMasterPageGallery();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public void GetMasterPageGallery()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;string siteURL = &quot;http://server:port/&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;using (SPSite site = new SPSite(siteURL))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SPWeb web = site.RootWeb;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SPList list = site.GetCatalog(SPListTemplateType.MasterPageCatalog);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;web.AllowUnsafeUpdates = true;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;SPFolder fol;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;try&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;fol = list.RootFolder.SubFolders[&quot;Target Folder&quot;];//This subfolder we will going to delete&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;catch&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;{ fol = null; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (fol != null)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;fol.Delete();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;web.AllowUnsafeUpdates = false;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now run the console application so it will delete the existing sub folder named &quot;Target Folder&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/7633845814160689992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/access-sharepoint-master-page-gallery.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/7633845814160689992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/7633845814160689992'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/access-sharepoint-master-page-gallery.html' title='Access the sharepoint master page gallery programatically'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3956357473933224479.post-2554884785203683254</id><published>2012-07-03T02:00:00.000-07:00</published><updated>2012-07-04T02:51:39.705-07:00</updated><title type='text'>Add the content editor web-part to the page layout progrmatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hello All,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Today we will add the content editor web-part to the page layout with the specified the webpart zone and also add some HTML content to the web-part.For that we will use the console application using visual studio 2010.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So first create one window console application using visual studio 2010.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Then add the Microsoft.Sharepoint.dll refence form the ISAPI folder from 14 hive directory( &quot;C:\Program&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI&quot;).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;So below are my source code&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;namespace AddSampleData&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;class Program&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;static void Main(string[] args)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;string pageURL = args[0]; &amp;nbsp;//&quot;http://server:port/pages/default.aspx&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;string strHTML = &quot;&amp;lt;div&amp;gt;This is my first blog posting&amp;lt;/div&amp;gt;&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;using (SPSite site = new SPSite(pageURL))&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;using (SPWeb web = site.OpenWeb())&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AddContentEditorToWebPartZone(web, pageURL, &quot;Zone_ID&quot;, strHTML);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;#region To Add webparts with data to page zones&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;public static void AddContentEditorToWebPartZone(SPWeb web, string url, string zoneId, string content)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;SPLimitedWebPartManager webpartmanager = web.GetLimitedWebPartManager(url, PersonalizationScope.Shared);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;ContentEditorWebPart cewp = new ContentEditorWebPart();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cewp.ChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.None;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;XmlDocument docXml = new System.Xml.XmlDocument();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;XmlElement contentXml = docXml.CreateElement(&quot;Content&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;contentXml.InnerText = content;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;cewp.Content = contentXml;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;webpartmanager.AddWebPart(cewp, zoneId, 0);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Now run the console application it will take 1 argument the page url in which we are going to add the content editor webpart.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Regards&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Hiren Patel&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hiren-j-patel.blogspot.com/feeds/2554884785203683254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/hello-all-today-we-will-add-content.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2554884785203683254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3956357473933224479/posts/default/2554884785203683254'/><link rel='alternate' type='text/html' href='http://hiren-j-patel.blogspot.com/2012/07/hello-all-today-we-will-add-content.html' title='Add the content editor web-part to the page layout progrmatically'/><author><name>Hiren Patel</name><uri>http://www.blogger.com/profile/13067553540563943851</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>