<?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: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-384738507277930699</id><updated>2011-09-22T13:39:12.757-07:00</updated><category term='SharePoint'/><category term='People Picker'/><category term='MOSS People Picker'/><category term='SharePoint People Picker'/><title type='text'>MOSS Solutions</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-460376830768485294</id><published>2011-03-31T01:36:00.000-07:00</published><updated>2011-03-31T01:36:26.045-07:00</updated><title type='text'>SharePoint custom Master Page Do Not Print</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" id="ctl00_MiddleContent_FirstPostGrid"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;div class="groupcontainer"&gt;&lt;div class="groupbubble_content"&gt;&lt;div class="top_left"&gt;&lt;/div&gt;&lt;div class="bubblemessagetext"&gt;&lt;table border="0" cellpadding="2" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="left"&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;When using Microsoft custom Master Pages, print preview pages dont show any&lt;br /&gt;content in the body of the page.&amp;nbsp;&lt;/b&gt;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Reason&lt;/b&gt;: Sharepoint use core.css file in which they write few classes where they says that this class should not be use for print/media.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Solution&lt;/b&gt;: While customizing make sure not to use those classes on top of your body area. So that it wont hide it.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Few classes&lt;/b&gt;: Few of classes I m mentioning below which if you use on top of body area then print will not display content.&lt;/pre&gt;&lt;div style="color: black; direction: ltr; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .ms-leftareacell,.ms-globallinks,.ms-siteaction,.ms-areaseparatorleft,.ms-rightareacell,.ms-areaseparatorright, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .ms-areaseparatorcorner,.ms-titlearealeft,.ms-titlearearight,.ms-searchform,.ms-banner,.ms-buttonheightwidth,.ms-buttonheightwidth2&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Hope this help you.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: purple;"&gt;&lt;span style="font-size: small;"&gt;Thanks!&lt;/span&gt;&lt;/div&gt;&lt;div style="color: purple;"&gt;&lt;span style="font-size: small;"&gt;Avinash&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-460376830768485294?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/460376830768485294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=460376830768485294&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/460376830768485294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/460376830768485294'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2011/03/sharepoint-custom-master-page-do-not.html' title='SharePoint custom Master Page Do Not Print'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-2649855218383180590</id><published>2011-03-31T01:35:00.000-07:00</published><updated>2011-03-31T01:38:23.973-07:00</updated><title type='text'>Using Microsoft Custom MasterPages I don't see content in Print Preview</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" id="ctl00_MiddleContent_FirstPostGrid"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;div class="groupcontainer"&gt;&lt;div class="groupbubble_content"&gt;&lt;div class="top_left"&gt;&lt;/div&gt;&lt;div class="bubblemessagetext"&gt;&lt;table border="0" cellpadding="2" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="left"&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;When using Microsoft custom Master Pages, print preview pages dont show any&lt;br /&gt;content in the body of the page.&amp;nbsp;&lt;/b&gt;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Reason&lt;/b&gt;: Sharepoint use core.css file in which they write few classes where they says that this class should not be use for print/media.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Solution&lt;/b&gt;: While customizing make sure not to use those classes on top of your body area. So that it wont hide it.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Few classes&lt;/b&gt;: Few of classes I m mentioning below which if you use on top of body area then print will not display content.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;/pre&gt;&lt;div style="color: black; direction: ltr; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .ms-leftareacell,.ms-globallinks,.ms-siteaction,.ms-areaseparatorleft,.ms-rightareacell,.ms-areaseparatorright, &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .ms-areaseparatorcorner,.ms-titlearealeft,.ms-titlearearight,.ms-searchform,.ms-banner,.ms-buttonheightwidth,.ms-buttonheightwidth2&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Hope this help you.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: purple;"&gt;&lt;span style="font-size: small;"&gt;Thanks!&lt;/span&gt;&lt;/div&gt;&lt;div style="color: purple;"&gt;&lt;span style="font-size: small;"&gt;Avinash&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-2649855218383180590?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/2649855218383180590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=2649855218383180590&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/2649855218383180590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/2649855218383180590'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2011/03/using-microsft-custom-masterpages-i.html' title='Using Microsoft Custom MasterPages I don&apos;t see content in Print Preview'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-484645570928383457</id><published>2011-03-31T01:33:00.000-07:00</published><updated>2011-03-31T01:33:38.546-07:00</updated><title type='text'>print preview dont show any content of the sharepoint page</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;table border="0" cellpadding="0" cellspacing="0" id="ctl00_MiddleContent_FirstPostGrid"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;  &lt;div class="groupcontainer"&gt;    &lt;div class="groupbubble_content"&gt;      &lt;div class="top_left"&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="bubblemessagetext"&gt;&lt;table border="0" cellpadding="2" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="left"&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;When using Microsoft custom Master Pages, print preview pages dont show any&lt;br /&gt;content in the body of the page.&amp;nbsp;&lt;/b&gt;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Reason&lt;/b&gt;: Sharepoint use core.css file in which they write few classes where they says that this class should not be use for print/media.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Solution&lt;/b&gt;: While customizing make sure not to use those classes on top of your body area. So that it wont hide it.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;b&gt;Few classes&lt;/b&gt;: Few of classes I m mentioning below which if you use on top of body area then print will not display content.&lt;/pre&gt;&lt;pre class="FreeTextNG"&gt;&lt;/pre&gt;&lt;div style="color: black; direction: ltr; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .ms-leftareacell,.ms-globallinks,.ms-siteaction,.ms-areaseparatorleft,.ms-rightareacell,.ms-areaseparatorright,  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .ms-areaseparatorcorner,.ms-titlearealeft,.ms-titlearearight,.ms-searchform,.ms-banner,.ms-buttonheightwidth,.ms-buttonheightwidth2&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: small;"&gt;Hope this help you.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: purple;"&gt;&lt;span style="font-size: small;"&gt;Thanks!&lt;/span&gt;&lt;/div&gt;&lt;div style="color: purple;"&gt;&lt;span style="font-size: small;"&gt;Avinash&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-484645570928383457?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/484645570928383457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=484645570928383457&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/484645570928383457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/484645570928383457'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2011/03/print-preview-dont-show-any-content-of.html' title='print preview dont show any content of the sharepoint page'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-2252681741283606990</id><published>2011-02-07T19:32:00.000-08:00</published><updated>2011-02-07T19:32:39.006-08:00</updated><title type='text'>Retrieve Web part Title in Contentquerymain.xsl</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;To retrieve webpart title in Contentquerymain.xsl, You can use Feed Title web part property, that if not set is equal to web part Title; to achieve this you need to add&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999; font-family: Verdana, sans-serif;"&gt;&amp;lt;xsl:param name="FeedTitle" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;to your custom ContentQueryMain.xsl in the params section. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Doing this the param FeedTitle will contain the web part Title and can be used inside xsl as below code&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999; font-family: Verdana, sans-serif;"&gt;&amp;lt;xsl:value-of select="$FeedTitle"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Thanks!&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Avinash&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-2252681741283606990?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/2252681741283606990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=2252681741283606990&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/2252681741283606990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/2252681741283606990'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2011/02/retrieve-web-part-title-in.html' title='Retrieve Web part Title in Contentquerymain.xsl'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-7876829615006384415</id><published>2011-01-26T17:17:00.000-08:00</published><updated>2011-01-26T17:17:32.501-08:00</updated><title type='text'>Programmatically adding items to a SharePoint list</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span style="background-color: #999999;"&gt;&lt;span class="kwrd"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;/span&gt;(SPSite site = &lt;span class="kwrd"&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;/span&gt; SPSite("http://"))&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt;&lt;/span&gt; (SPWeb web = site.OpenWeb())&lt;br /&gt;{&lt;br /&gt;SPList list = web.Lists[&lt;span class="str"&gt;&lt;span style="color: #006080;"&gt;"SharePointList"&lt;/span&gt;&lt;/span&gt;];&lt;br /&gt;SPListItem Item = list.Items.Add();&lt;br /&gt;item[&lt;span class="str"&gt;&lt;span style="color: #006080;"&gt;"Title"&lt;/span&gt;&lt;/span&gt;] = txtCompanyName.Text;&lt;br /&gt;&lt;span style="color: green;"&gt;&lt;span class="rem"&gt;//can add required items&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: green;"&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color: #999999;"&gt;item.Update();&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;Note: 1. No need to use SPSecurity.RunWithElevatedPrivileges.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. No need to use allowunsafeupdate property&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3. No need to update web object.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-7876829615006384415?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/7876829615006384415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=7876829615006384415&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/7876829615006384415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/7876829615006384415'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2011/01/programmatically-adding-items-to.html' title='Programmatically adding items to a SharePoint list'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-5321747118162411560</id><published>2011-01-26T17:11:00.000-08:00</published><updated>2011-01-26T17:11:02.087-08:00</updated><title type='text'>Creating a List programmatically using the sharepoint object model</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;strong&gt;Creating a List programmatically with out of the box List Template Types&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can create a list by picking one of the List Template Types available in the SPListTemplateType object. A full list can be found here.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: #666666; color: black;"&gt;Guid listId = web.Lists.Add("Test Custom List", "Name of list", SPListTemplateType.GenericList);&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #666666; color: black;"&gt;SPList list = web.Lists[listId];&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;h2&gt;OOTB List Templates&lt;/h2&gt;&lt;div class="table-wrap"&gt;&lt;table class="confluenceTable"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th align="left" class="confluenceTh"&gt;Name&lt;/th&gt;&lt;th align="left" class="confluenceTh"&gt;BaseType&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Events&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Contacts&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Tasks&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;PictureLibrary&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;DiscussionBoard&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Survey&lt;/td&gt;&lt;td class="confluenceTd"&gt;Survey&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Links&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Document Library&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Announcements&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;WorkflowHistory&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;DataConnectionLibrary&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;DataSources&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;GanttTasks&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;CustomGrid&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;NoCodeWorkflows&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;XMLForm&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;WebPageLibrary&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;WorkflowProcess&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Form Library&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;wiki&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Wiki Page Library&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Picture Library&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Picture&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Contacts&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Calendar&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Discussion Board&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Project Tasks&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Issue Tracking&lt;/td&gt;&lt;td class="confluenceTd"&gt;Issue&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Custom List&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Custom List in Datasheet View&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Survey&lt;/td&gt;&lt;td class="confluenceTd"&gt;Survey&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Custom Workflow Process&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Languages and Translators&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Translation Management Library&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;DataSources&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Data Connection Library&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;Workflow History&lt;/td&gt;&lt;td class="confluenceTd"&gt;GenericList&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="confluenceTd"&gt;No Code Workflows&lt;/td&gt;&lt;td class="confluenceTd"&gt;DocumentLibrary&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-5321747118162411560?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/5321747118162411560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=5321747118162411560&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/5321747118162411560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/5321747118162411560'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2011/01/creating-list-programmatically-using.html' title='Creating a List programmatically using the sharepoint object model'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-4277246364740832455</id><published>2010-11-17T21:32:00.001-08:00</published><updated>2010-11-17T21:33:20.386-08:00</updated><title type='text'>Avoiding Flickering in jQuery</title><content type='html'>Avoiding Flickering in jQuery on moss application&lt;br /&gt;Refer&lt;br /&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/11/flickering-issue-with-jquery-in.html"&gt;&lt;span style="color: blue;"&gt;http://avinash-moss-expert.blogspot.com/2010/11/flickering-issue-with-jquery-in.html&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-4277246364740832455?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/4277246364740832455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=4277246364740832455&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4277246364740832455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4277246364740832455'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/11/avoiding-flickering-in-jquery.html' title='Avoiding Flickering in jQuery'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-785230860984308146</id><published>2010-11-17T20:15:00.001-08:00</published><updated>2010-11-17T20:15:39.304-08:00</updated><title type='text'>Remove page flicker in sharepoint</title><content type='html'>refer&lt;br /&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/11/flickering-issue-with-jquery-in.html"&gt;http://avinash-moss-expert.blogspot.com/2010/11/flickering-issue-with-jquery-in.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-785230860984308146?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/785230860984308146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=785230860984308146&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/785230860984308146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/785230860984308146'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/11/remove-page-flicker-in-sharepoint.html' title='Remove page flicker in sharepoint'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-1326309963029487526</id><published>2010-11-17T20:13:00.000-08:00</published><updated>2010-11-17T21:29:27.492-08:00</updated><title type='text'>flickering issue with jquery in sharepoint</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;I had flickering issue on sharepoint site when i try to use jQuery. I search lots but none of solution works for me.Few solution are there on some blogs like:-&lt;br /&gt;&lt;a href="http://weblogs.asp.net/wesleybakker/archive/2008/12/29/Eliminate-page-flicker-in-SharePoint.aspx"&gt;&lt;span style="color: blue;"&gt;http://weblogs.asp.net/wesleybakker/archive/2008/12/29/Eliminate-page-flicker-in-SharePoint.aspx&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/wesleybakker/"&gt;&lt;span style="color: blue;"&gt;http://weblogs.asp.net/wesleybakker/&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.alligatortags.com/alligatortags-12-29-2008.html"&gt;&lt;span style="color: blue;"&gt;http://www.alligatortags.com/alligatortags-12-29-2008.html&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.developerit.com/en/search/page-138/get-the-title"&gt;&lt;span style="color: blue;"&gt;http://www.developerit.com/en/search/page-138/get-the-title&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.psearch.info/s/irritating-flicker-postbacks-server"&gt;&lt;span style="color: blue;"&gt;http://www.psearch.info/s/irritating-flicker-postbacks-server&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;as per these above blogs below code solve issue&lt;br /&gt;&amp;lt;meta http-equiv="Page-Exit" content="blendTrans(Duration=0.0)" /&amp;gt;&lt;br /&gt;but all these does not solve my issue. Finaly i got solution which is mentioned below:- &lt;br /&gt;&lt;br /&gt;In sharepoint we start using jQuery or JavaScript like below:-&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;span style="background-color: #999999;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;_spBodyOnLoadFunctionNames.push("RoundCorner");&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;function RoundCorner() {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;// all js code will come here&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;$('div.graybackground').corner("round");&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;// all js code will come here&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I add two lines extra in script and replace function as below:-&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;/span&gt;&lt;span style="background-color: #999999;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;_spBodyOnLoadFunctionNames.push("RoundCorner");&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;function RoundCorner() {&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #ffd966;"&gt;$('body').css('display', 'none');&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;// all js code will come here&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;$('div.graybackground').corner("round");&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;// all js code will come here&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #ffd966;"&gt;$('body').css('display', 'block');&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #999999;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &lt;br /&gt;Thanks!&lt;br /&gt;Avinash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-1326309963029487526?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/1326309963029487526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=1326309963029487526&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/1326309963029487526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/1326309963029487526'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/11/flickering-issue-with-jquery-in.html' title='flickering issue with jquery in sharepoint'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-7272515501679406123</id><published>2010-11-10T20:08:00.000-08:00</published><updated>2010-11-12T21:47:06.157-08:00</updated><title type='text'>custom pagination in gridview</title><content type='html'>If&amp;nbsp;you want to implement custom&amp;nbsp;pagination having&amp;nbsp;"Next" and "Prev" button&amp;nbsp;in gridview then you have following options:-&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/aspnet/CustomPagingForGridview.aspx"&gt;http://www.codeproject.com/KB/aspnet/CustomPagingForGridview.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa479347.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa479347.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx"&gt;http://dotnetslackers.com/articles/ajax/ASPNETAjaxGridAndPager.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But i have got one more good solution which works well for me. See below:-&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;GridView1.PagerSettings.Mode = PagerButtons.NumericFirstLast;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;GridView1.PagerSettings.NextPageText = "&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;GridView1.PagerSettings.PreviousPageText = "&amp;lt;"; GridView1.PagerSettings.LastPageText = "&amp;gt;&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;GridView1.PagerSettings.FirstPageText = "&amp;lt;&amp;lt;"; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;GridView1.RowDataBound+=new GridViewRowEventHandler(GridView1_RowDataBound);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;if (e.Row.RowType == DataControlRowType.Pager)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{ Table pagerTable = (Table)e.Row.Cells[0].Controls[0];&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;TableRow pagerRow = pagerTable.Rows[0];&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;PagerSettings pagerSettings = ((GridView)sender).PagerSettings;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;int cellsCount = pagerRow.Cells.Count;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;if (pagerSettings.Mode == PagerButtons.Numeric || pagerSettings.Mode == PagerButtons.NumericFirstLast) {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;int prevButtonIndex = pagerSettings.Mode==PagerButtons.Numeric ? 0 : 1;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;int nextButtonIndex = pagerSettings.Mode==PagerButtons.Numeric ? cellsCount-1 : cellsCount-2;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;if (prevButtonIndex &amp;lt; cellsCount)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{ //check whether previous button exists LinkButton btnPrev = pagerRow.Cells[prevButtonIndex].Controls[0] as LinkButton; if (btnPrev != null &amp;amp;&amp;amp; btnPrev.Text.IndexOf("...") != -1) btnPrev.Text = pagerSettings.PreviousPageText;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;if (nextButtonIndex &amp;gt; 0 &amp;amp;&amp;amp; nextButtonIndex &amp;lt; cellsCount)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;//check whether next button exists &lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;LinkButton btnNext = pagerRow.Cells[nextButtonIndex].Controls[0] as LinkButton;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;if (btnNext != null &amp;amp;&amp;amp; btnNext.Text.IndexOf("...") != -1)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;btnNext.Text = pagerSettings.NextPageText;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Thanks!&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;Avinash&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-7272515501679406123?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/7272515501679406123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=7272515501679406123&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/7272515501679406123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/7272515501679406123'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/11/custom-pagination-in-gridview.html' title='custom pagination in gridview'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-3608204489028489246</id><published>2010-10-21T01:14:00.000-07:00</published><updated>2010-10-21T01:35:56.244-07:00</updated><title type='text'>How to control "Access Denied" page</title><content type='html'>The SPUtility.HandleAccessDenied method provides the functionality to redirect users to the standard "Access Denied Page" pragmatically, thus asking them to re-logon. One of the scenarios of such usage is the public sites, where access to the standard SharePoint specific pages still exists and you want to block those pages&lt;br /&gt;&lt;br /&gt;However, you can handle access denied exception via SPSecurity.CatchAccessDeniedException = true &lt;a href="http://avinash-moss-solutions.blogspot.com/2010/10/how-to-avoid-access-denied-page.html"&gt;&lt;span style="color: blue;"&gt;(source)&lt;/span&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-3608204489028489246?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/3608204489028489246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=3608204489028489246&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3608204489028489246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3608204489028489246'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/10/how-to-control-access-denied-page.html' title='How to control &quot;Access Denied&quot; page'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-8828735668872418272</id><published>2010-10-21T01:12:00.000-07:00</published><updated>2010-10-21T01:12:42.036-07:00</updated><title type='text'>How to avoid Access denied page</title><content type='html'>Access deined exception is handled by sharepoint platform and user will be redirected to _layouts/AccessDenied.aspx page if user doesnt have permission to perform that task. This might casue usability problem in some cases. You can handle access denied exception in your code by setting CatchAccessDeniedException value to true.&lt;br /&gt;Following code snippet shows how to handle access denied exception:&lt;br /&gt;&lt;br /&gt;bool catchException = SPSecurity.CatchAccessDeniedException;&lt;br /&gt;SPSecurity.CatchAccessDeniedException = false;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;//updating list item&lt;br /&gt;SPList list = SPcontext.Current.Web.List["TestList"];&lt;br /&gt;SPListItem item = list.Items[0];&lt;br /&gt;item["title"] = "Some value";&lt;br /&gt;//If user doesnt have permission, exception will be thrown&lt;br /&gt;//If value of CatchAccessDeniedException is true, then user will be&lt;br /&gt;//redirected to AccessDenied.aspx page&lt;br /&gt;item.Update();&lt;br /&gt;}&lt;br /&gt;cach(Exception ex)&lt;br /&gt;{&lt;br /&gt;//Your custom error message can be shown here&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;//reset the flag to original value&lt;br /&gt;SPSecurity.CatchAccessDeniedException = catchException;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;Reference: sridharu blog.&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Avinash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-8828735668872418272?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/8828735668872418272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=8828735668872418272&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8828735668872418272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8828735668872418272'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/10/how-to-avoid-access-denied-page.html' title='How to avoid Access denied page'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-5038937054406139378</id><published>2010-10-20T18:36:00.000-07:00</published><updated>2010-10-20T18:36:43.283-07:00</updated><title type='text'>Custom Content Query Web Part</title><content type='html'>When we need to add some custom property into OOB CQWP then we have to create custom CQWP.&lt;br /&gt;As well as when we need redeploy CQWP then also we need to use custom content query web part.&lt;br /&gt;&lt;br /&gt;Please view below code to create custom content query web part:-&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;1 point: We need to create a custom class whcih extend OOB content query web part class&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;public class CustomPortalContentQuery : ContentByQueryWebPart&lt;br /&gt;{&lt;br /&gt;public override ToolPart[] GetToolParts()&lt;br /&gt;{&lt;br /&gt;List&lt;toolpart&gt; toolPart = new List&lt;toolpart&gt;(base.GetToolParts());&lt;br /&gt;toolPart.Insert(0, new CustomPortalToolPart());&lt;br /&gt;return toolPart.ToArray();&lt;br /&gt;}&lt;br /&gt;protected override void OnInit(EventArgs e)&lt;br /&gt;{&lt;br /&gt;FixListGuid(); // this to fix list guid if you are redeploying cqwp to other site&lt;br /&gt;this.ItemXslLink = this.ServerRelativeItemXslLink;&lt;br /&gt;this.MainXslLink = this.ServerRelativeMainXslLink;&lt;br /&gt;base.OnInit(e);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;protected override void CreateChildControls()&lt;br /&gt;{&lt;br /&gt;base.CreateChildControls();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void FixListGuid(){&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;if (!string.IsNullOrEmpty(base.WebUrl) &amp;amp;&amp;amp; !string.IsNullOrEmpty(base.ListName))&lt;br /&gt;{&lt;br /&gt;using (SPWeb web = SPContext.Current.Site.OpenWeb(base.WebUrl, true))&lt;br /&gt;{base.ListGuid = web.Lists[base.ListName].ID.ToString();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch (Exception ex){}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;u&gt;2 point: We need to create a custom class for tool pane.&lt;/u&gt;&lt;/strong&gt; &lt;br /&gt;internal&amp;nbsp;class CountryPortalToolPart : Microsoft.SharePoint.WebPartPages.ToolPart&lt;br /&gt;{&lt;br /&gt;CustomPortalContentQuery webpart;&lt;br /&gt;TextBox itemXslLink;&lt;br /&gt;Panel toolPanel;&lt;br /&gt;Table toolPanelTable;&lt;br /&gt;public CountryPortalToolPart()&lt;br /&gt;{&lt;br /&gt;this.Title = "Custom Settings";&lt;br /&gt;}&lt;br /&gt;protected override void CreateChildControls()&lt;br /&gt;{&lt;br /&gt;webpart = this.WebPartToEdit as CustomPortalContentQuery;&lt;br /&gt;toolPanel = new Panel();toolPanel.CssClass = "ms-ToolPartSpacing";&lt;br /&gt;toolPanel.Controls.Add(GetToolPanel()); &lt;br /&gt;this.Controls.Add(toolPanel);&lt;br /&gt;base.CreateChildControls();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public override void ApplyChanges()&lt;br /&gt;{try&lt;br /&gt;{&lt;br /&gt;webpart.ItemXslLink = itemXslLink.Text;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;catch { }&lt;br /&gt;&lt;br /&gt;base.ApplyChanges();}&lt;br /&gt;private Control GetToolPanel()&lt;br /&gt;{&lt;br /&gt;toolPanelTable = new Table();&lt;br /&gt;toolPanelTable.CellPadding = 0;&lt;br /&gt;toolPanelTable.CellSpacing = 0;&lt;br /&gt;toolPanelTable.Style["border-collapse"] = "collapse";&lt;br /&gt;toolPanelTable.Attributes.Add("width", "100%");&lt;br /&gt;toolPanelTable.Rows.Add(GetItemXslLinkRow());&lt;br /&gt;return toolPanelTable;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private TableRow GetItemXslLinkRow()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;TableRow row = new TableRow();&lt;br /&gt;TableCell cell = new TableCell();&lt;br /&gt;&lt;br /&gt;cell.Controls.Add(new LiteralControl("&lt;br /&gt;&lt;div class="\&amp;quot;UserSectionHead\&amp;quot;"&gt;&lt;b&gt;Item XSL Link:&lt;/b&gt;&lt;/div&gt;"));&lt;br /&gt;cell.Controls.Add(new LiteralControl("&lt;br /&gt;&lt;div class="\&amp;quot;UserSectionBody\&amp;quot;"&gt;&lt;div class="\&amp;quot;UserControlGroup\&amp;quot;"&gt;&lt;nobr&gt;")); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;itemXslLink = new TextBox(); &lt;br /&gt;if (string.IsNullOrEmpty(webpart.ItemXslLink))&lt;br /&gt;{&lt;br /&gt;itemXslLink.Text = this.webpart.ServerRelativeItemXslLink;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;itemXslLink.Text = this.webpart.ItemXslLink;&lt;br /&gt;cell.Controls.Add(itemXslLink);&lt;br /&gt;cell.Controls.Add(new LiteralControl("&lt;/nobr&gt;&lt;/div&gt;&lt;/div&gt;"));&lt;br /&gt;row.Cells.Add(cell);&lt;br /&gt;return row;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope it helps you.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: purple;"&gt;Thanks!&lt;/span&gt;&lt;br /&gt;&lt;span style="color: purple;"&gt;Aviansh&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-5038937054406139378?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/5038937054406139378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=5038937054406139378&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/5038937054406139378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/5038937054406139378'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/10/custom-content-query-web-part.html' title='Custom Content Query Web Part'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-4896252206028023257</id><published>2010-10-20T18:11:00.000-07:00</published><updated>2010-11-12T21:27:15.329-08:00</updated><title type='text'>import content query web part to other site</title><content type='html'>While import exiting CQWP from one site to other site, gives an issue of List GUID. It does not work since it point to old site list guid.&lt;br /&gt;&lt;br /&gt;I got solution for this. First of course we need to create Custom CQWP whcih extent OOB CQWP. then i wrote a function to fix listGUID issue.&lt;br /&gt;please refer my article &lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/10/making-content-query-web-part.html"&gt;Making the content query web part deployable&lt;/a&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Avinash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-4896252206028023257?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/4896252206028023257/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=4896252206028023257&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4896252206028023257'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4896252206028023257'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/10/import-content-query-web-part-to-other.html' title='import content query web part to other site'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-3384556426010598112</id><published>2010-10-20T18:07:00.000-07:00</published><updated>2010-11-12T21:28:51.345-08:00</updated><title type='text'>Making the content query web part deployable</title><content type='html'>My biggest issue with the CQWP? its not deployable when connected to a specific list in a specific site.&lt;br /&gt;If you configure a CQWP web part to connect to a list in a site, the web part saves the ID (GUID) of the list - and if you want to deploy the web part as part of a feature or onet.xml so that the web part gets added every time a user creates a site, it will fail - because the ID of the list changes every time you create a new site. &lt;br /&gt;My solution? override the web part and implement the following functions: &lt;b&gt;&lt;br /&gt;private void FixListGuid()&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;if (!string.IsNullOrEmpty(base.WebUrl) &amp;amp;&amp;amp; !string.IsNullOrEmpty(base.ListName))&lt;br /&gt;{&lt;br /&gt;using (SPWeb web = SPContext.Current.Site.OpenWeb(base.WebUrl, true))&lt;br /&gt;{&lt;br /&gt;base.ListGuid = web.Lists[base.ListName].ID.ToString();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;SPZetaContext.GetContext(HttpContext.Current).Log.Warn("Unable to resolve SPList '" + this.ListName + "'", ex);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;protected override void OnLoad(EventArgs e)&lt;br /&gt;{&lt;br /&gt;FixListGuid ();&lt;br /&gt;base.OnLoad(e);&lt;br /&gt;}&lt;br /&gt;}&lt;/b&gt;&lt;br /&gt;This code works for me..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/10/custom-content-query-web-part.html"&gt;&lt;span style="color: blue;"&gt;How to create custom Content Query Web Part&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: purple;"&gt;Thanks!&lt;/span&gt;&lt;br /&gt;&lt;span style="color: purple;"&gt;Avinash&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-3384556426010598112?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/3384556426010598112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=3384556426010598112&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3384556426010598112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3384556426010598112'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/10/making-content-query-web-part.html' title='Making the content query web part deployable'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-8482308682950629316</id><published>2010-10-08T22:44:00.000-07:00</published><updated>2010-10-08T22:46:38.647-07:00</updated><title type='text'>This page contains content or formatting that is not valid. You can find more information in the affected sections</title><content type='html'>You get this error when you are trying to update a SharePoint webpart tool part or something like that and you click on 'Publish' page button. This only happens if you have any Validation Controls on your webpart.&lt;br /&gt;&lt;br /&gt;Resolution: As you have validation controls on your webpart UI and you are not filling in anything, it is not letting your page to postback and you need to disable rendering the webpart while you are modifying the toolpart. You can do that by writing down code as below in your 'CreateChildControls method of webpart&lt;br /&gt;&lt;br /&gt;protected override void CreateChildControls()&lt;br /&gt;{ &lt;br /&gt;&lt;br /&gt;WebPartManager wp = WebPartManager.GetCurrentWebPartManager(this.Page); &lt;br /&gt;if (wp.DisplayMode == WebPartManager.BrowseDisplayMode)&lt;br /&gt;{&lt;br /&gt; // add your validator control&lt;br /&gt;} &lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;// dont add  your validator control&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;base.CreateChildControls(); &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Thanks &amp; Regards,&lt;br /&gt;Avinash Dad&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-8482308682950629316?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/8482308682950629316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=8482308682950629316&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8482308682950629316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8482308682950629316'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/10/this-page-contains-content-or.html' title='This page contains content or formatting that is not valid. You can find more information in the affected sections'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-43985800747639132</id><published>2010-10-04T01:01:00.000-07:00</published><updated>2010-10-11T23:20:17.636-07:00</updated><title type='text'>Document Icon in CQWP</title><content type='html'>You can find solution on some blogs like:-&lt;br /&gt;http://edinkapic.blogspot.com/2007/09/document-icon-in-cqwp.html&lt;br /&gt;&lt;br /&gt;But I got very short solution which is mentioned below:-&lt;br /&gt;&lt;br /&gt;First, we should add the DocIcon in the CommonViewFields property (export the CQWP, edit the .webpart file) as follows:&lt;br /&gt;&lt;br /&gt;&amp;lt;property name="CommonViewFields" type="string""&amp;gt;DocIcon, Lookup;&amp;lt;/property"&amp;gt;&lt;br /&gt;&lt;br /&gt;Then, you can use following tempalte to get icon:-&lt;br /&gt;&lt;br /&gt;&amp;lt;xsl:template name="RecentDcoument" match="Row[@Style='RecentDcoument']" mode="itemstyle"&amp;gt;&lt;br /&gt;&amp;lt;xsl:variable name="SafeLinkUrl"&amp;gt;&lt;br /&gt;&amp;lt;xsl:call-template name="OuterTemplate.GetSafeLink"&amp;gt;&lt;br /&gt;&amp;lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"/&amp;gt;&lt;br /&gt;&amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;&amp;lt;div id="linkitem" class="item" style="vertical-align:middle;"&amp;gt;&lt;br /&gt;&amp;lt;div style="float:left;"&amp;gt;&lt;br /&gt;&lt;b&gt;&amp;lt;IMG BORDER="0" ALT="{@FileLeafRef}" title="{@FileLeafRef}" SRC="/_layouts/images/{ddwrt:MapToIcon(string(@DocIcon),string(@DocIcon))}" /&amp;gt;&lt;/b&gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/&amp;gt;&lt;br /&gt;&amp;lt;a href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}" style="padding-left:5px;"&amp;gt;&lt;br /&gt;&amp;lt;xsl:value-of select="ddwrt:UrlBaseName(string($SafeLinkUrl))" /&amp;gt;&lt;br /&gt;&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/xsl:template&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-43985800747639132?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/43985800747639132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=43985800747639132&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/43985800747639132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/43985800747639132'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/10/document-icon-in-cqwp.html' title='Document Icon in CQWP'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-8261860108229439560</id><published>2010-08-11T23:57:00.000-07:00</published><updated>2010-11-12T21:30:47.382-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Export Webpart programmatically using SPLimitedWebpartManager</title><content type='html'>Export Webpart programmatically&lt;br /&gt;&lt;br /&gt;==========================================================================&lt;br /&gt;&lt;br /&gt;private void ExportWebpart(SPLimitedWebPartManager wpm, string strFilePath)&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;XmlTextWriter writer;&lt;br /&gt;foreach (var webPartOnPage in wpm.WebParts)&lt;br /&gt;{&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;System.Web.UI.WebControls.WebParts.WebPart webPartObj = (System.Web.UI.WebControls.WebParts.WebPart)(webPartOnPage);&lt;br /&gt;&lt;br /&gt;if (!Directory.Exists(strFolderPath))&lt;br /&gt;{&lt;br /&gt;Directory.CreateDirectory(strFolderPath);&lt;br /&gt;}&lt;br /&gt;//Store below detail into xml since some web part does not export (eg: filter text web part)&lt;br /&gt;// So while import we can use below detail and addwebpart using assembly name.&lt;br /&gt;&lt;br /&gt;// RemoveSpecialCharacters(webPartObj.Title);&lt;br /&gt;// wpm.GetZoneID(webPartObj);&lt;br /&gt;// webPartObj.ZoneIndex;&lt;br /&gt;// webPartObj.GetType().AssemblyQualifiedName;&lt;br /&gt;&lt;br /&gt;writer = new XmlTextWriter(strFilePath, Encoding.UTF8);&lt;br /&gt;wpm.ExportWebPart(webPartObj, writer);&lt;br /&gt;&lt;br /&gt;writer.Flush();&lt;br /&gt;writer.Close(); &lt;br /&gt;}&lt;br /&gt;catch {}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;==========================================================================&lt;br /&gt;&lt;br /&gt;This above function can be use for following points:-&lt;br /&gt;&lt;br /&gt;SPLimitedWebpartManager.ExportWebPart(Webpart, XmlWriter) throws XmlException&lt;br /&gt;like below:-&lt;br /&gt;The prefix '' cannot be redefined from '' to 'http://schemas.microsoft.com/WebPart/v3' within the same start element tag.&lt;br /&gt;Then change xmlwriter to xmltextwriter. Same you can see in above function.&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;SPLimitedWebpartManager.ExportWebPart&lt;br /&gt;&lt;br /&gt;The biggest issue:-&lt;br /&gt;============================&lt;br /&gt;&lt;br /&gt;SPLimitedWebpartManager.ExportWebPart(Webpart, XmlWriter) throws XmlException&lt;br /&gt;XmlException when you use Text Filter Web Part (SPSlicerTextWebPart)&lt;br /&gt;As per understanding, There is no solution for this. So I have other work around for this. &lt;br /&gt;&lt;br /&gt;Why we are exporting? Since we might want import to some other site.&lt;br /&gt;&lt;br /&gt;So what we can do, while export, store webpart detail in xml file. And while import creates 2 function as mentioned below:-&lt;br /&gt;&lt;br /&gt;1. this is for those which have .webpart file &lt;br /&gt;&lt;br /&gt;for this use &lt;a href="http://avinash-moss-expert.blogspot.com/2010/08/add-web-part-programmatically-using.html"&gt;&lt;span style="color: blue;"&gt;my function "AddWebPartToPage" which u can refer from other article.&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. This is: for those which does not have webpart file means it couldn’t export. Then use following function to addwebpart&lt;br /&gt;&lt;br /&gt;private void AddWebPartToPageUsingAssembly(string strWebPartName, SPWeb oWeb, string strZoneId, int ZoneIndex, SiteWebPart webpartSetting)&lt;br /&gt;{&lt;br /&gt;//here webPartSetting object contains the properties of those webpart which couldn’t export&lt;br /&gt;// you can get these object using the xml which you have exported while webpart export.&lt;br /&gt;&lt;br /&gt;SPFile file = null;&lt;br /&gt;SPLimitedWebPartManager manager = null;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;if (webpartSetting != null)&lt;br /&gt;{&lt;br /&gt;string strType = webpartSetting.Settings.AssemblyType;&lt;br /&gt;Type type = Type.GetType(strType);&lt;br /&gt;Assembly assemblyType = type.Assembly;&lt;br /&gt;System.Web.UI.WebControls.WebParts.WebPart webPartObj = (System.Web.UI.WebControls.WebParts.WebPart)assemblyType.CreateInstance(type.FullName);&lt;br /&gt;webPartObj.ChromeType = PartChromeType.None;&lt;br /&gt;webPartObj.Title = webpartSetting.Settings.Title;&lt;br /&gt;&lt;br /&gt;if (String.Compare(webPartObj.GetType().Name, "SPSlicerTextWebPart", true) == 0)&lt;br /&gt;{&lt;br /&gt;(((Microsoft.SharePoint.Portal.WebControls.SPSlicerBaseWebPart)(webPartObj))).FilterName = webpartSetting.Settings.FilterName;&lt;br /&gt;}&lt;br /&gt;file = oWeb.GetFile(strPageUrl);&lt;br /&gt;&lt;br /&gt;if (file.CheckOutStatus == SPFile.SPCheckOutStatus.None)&lt;br /&gt;{&lt;br /&gt;file.CheckOut();&lt;br /&gt;manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared);&lt;br /&gt;manager.AddWebPart(webPartObj, strZoneId, ZoneIndex);&lt;br /&gt;oWeb.Update();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;catch (Exception ex)&lt;br /&gt;{&lt;br /&gt;// Exception details&lt;br /&gt;}&lt;br /&gt;finally&lt;br /&gt;{&lt;br /&gt;if (manager != null)&lt;br /&gt;manager.Dispose();&lt;br /&gt;&lt;br /&gt;if (file != null)&lt;br /&gt;{&lt;br /&gt;file.CheckIn("added web parts");&lt;br /&gt;file.Publish("added web parts");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;===============================================================&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Avinash Dad&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-8261860108229439560?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/8261860108229439560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=8261860108229439560&amp;isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8261860108229439560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8261860108229439560'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/08/export-webpart-programmatically-using.html' title='Export Webpart programmatically using SPLimitedWebpartManager'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-156980720997121784</id><published>2010-08-11T23:55:00.000-07:00</published><updated>2010-08-12T00:34:17.471-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Retrieve webpart connection details programmatically using SPWebPartConnection</title><content type='html'>If you wish to retrieve the webpart information programmatically then you can use following function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        private void  FindConnectedWebPart(SPLimitedWebPartManager wpm)&lt;br /&gt;        {&lt;br /&gt;            SPWebPartConnectionCollection webPartConColl = wpm.SPWebPartConnections;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                foreach (SPWebPartConnection webPartCon in webPartConColl)&lt;br /&gt;                {&lt;br /&gt;                    string strProviderTitle = RemoveSpecialCharacters(webPartCon.Provider.Title);&lt;br /&gt;                    string strConsumerTitle = RemoveSpecialCharacters(webPartCon.Consumer.Title);&lt;br /&gt;  if (String.Compare(webPartCon.Provider.GetType().Name, "SPSlicerTextWebPart", true) == 0)&lt;br /&gt;                        {&lt;br /&gt;  string strFilterName = ((Microsoft.SharePoint.Portal.WebControls.SPSlicerBaseWebPart)(webPartCon.Provider)).FilterName;&lt;br /&gt;    }&lt;br /&gt;                    TransformableFilterValuesToFilterValuesTransformer transformerMapping = (TransformableFilterValuesToFilterValuesTransformer)webPartCon.Transformer;&lt;br /&gt;   // use these details as per your requirements&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;// exception detail&lt;br /&gt;            }&lt;br /&gt;         &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Avinash Dad&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-156980720997121784?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/156980720997121784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=156980720997121784&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/156980720997121784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/156980720997121784'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/08/retrieve-webpart-connection-details.html' title='Retrieve webpart connection details programmatically using SPWebPartConnection'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-6419677438605097511</id><published>2010-08-11T23:47:00.000-07:00</published><updated>2010-08-12T00:34:17.471-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Add Web Part programmatically using SPLimitedWebPartManager</title><content type='html'>Add Web Part programmatically &lt;br /&gt;&lt;br /&gt;=========================================================================&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     public void AddWebPartToPage(string webPartFullName, SPWeb web, string zoneId, int zoneIndex)&lt;br /&gt;        {&lt;br /&gt;            SPFile file = null;&lt;br /&gt;            XmlUrlResolver xmlResolver = new XmlUrlResolver();&lt;br /&gt;            xmlResolver.Credentials = CredentialCache.DefaultCredentials;&lt;br /&gt;            FileStream fs = new FileStream(webPartFullName, FileMode.OpenOrCreate);&lt;br /&gt;            XmlReader reader = new XmlTextReader(fs);&lt;br /&gt;            string errorMsg;&lt;br /&gt;            SPLimitedWebPartManager manager = null;&lt;br /&gt;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                file = web.GetFile(strPageUrl);&lt;br /&gt;                if (file.CheckOutStatus == SPFile.SPCheckOutStatus.None)&lt;br /&gt;                {&lt;br /&gt;                    file.CheckOut();&lt;br /&gt;                    manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared);&lt;br /&gt;                    System.Web.UI.WebControls.WebParts.WebPart tempWebPart = manager.ImportWebPart(reader, out errorMsg);&lt;br /&gt;                    manager.AddWebPart(tempWebPart, zoneId, zoneIndex);&lt;br /&gt;                    web.Update();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                // write exception&lt;br /&gt;            }&lt;br /&gt;            finally&lt;br /&gt;            {&lt;br /&gt;                if (manager != null)&lt;br /&gt;                    manager.Dispose();&lt;br /&gt;&lt;br /&gt;                if (file != null)&lt;br /&gt;                {&lt;br /&gt;                    file.CheckIn("added web parts");&lt;br /&gt;                    file.Publish("added web parts");&lt;br /&gt;                }&lt;br /&gt;                if (fs != null)&lt;br /&gt;                {&lt;br /&gt;                    fs.Close();&lt;br /&gt;                    fs.Dispose();&lt;br /&gt;                }&lt;br /&gt;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;=========================================================================&lt;br /&gt;&lt;br /&gt;this above function can be use for following points:-&lt;br /&gt;&lt;br /&gt;Import WebPart programmatically using SPLimitedWebPartManager&lt;br /&gt;or&lt;br /&gt;Add Web Part programmatically using SPLimitedWebPartManager&lt;br /&gt;or&lt;br /&gt;Add Web Part to Page Programmatically&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;any exception comes like this:-&lt;br /&gt;Throws this error on ImportWebPart..."The file you imported is not&lt;br /&gt;valid. Verify that the file is a Web Part description file (*.webpart&lt;br /&gt;or *.dwp) and that it contains well-formed XML."&lt;br /&gt;&lt;br /&gt;then its issue with credential. please us CredentialCache.DefaultCredentials as mention in above function.&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;any exception comes like this:-&lt;br /&gt;"Object reference not set to an instance of an object" while ImportWebPart&lt;br /&gt; then its isse with loading file. Dont use File to load use FileStream as mentioned in above function.&lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;SPLimitedWebPartManager.AddWebPart():&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Avinash Dad&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-6419677438605097511?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/6419677438605097511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=6419677438605097511&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/6419677438605097511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/6419677438605097511'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/08/add-web-part-programmatically-using.html' title='Add Web Part programmatically using SPLimitedWebPartManager'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-4323099850074108796</id><published>2010-08-11T23:42:00.000-07:00</published><updated>2010-08-12T00:34:17.471-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Connect webparts programmatically using SPConnectWebParts</title><content type='html'>If you wish to connect two webpart where you have webpart consumer and webpart provider object then you can use following idea to implement functionality.&lt;br /&gt;&lt;br /&gt;========================================================================&lt;br /&gt;        private void ConnectWebPartOnPage(SPWeb oWeb, WebPart webPartConsumer, WebPart webPartProvider, string MappingId)&lt;br /&gt;        {&lt;br /&gt;            SPFile file = null;&lt;br /&gt;            SPLimitedWebPartManager manager = null;&lt;br /&gt;            file = oWeb.GetFile(strPageUrl);&lt;br /&gt;&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                if (file.CheckOutStatus == SPFile.SPCheckOutStatus.None)&lt;br /&gt;                {&lt;br /&gt;                    file.CheckOut();&lt;br /&gt;                    manager = file.GetLimitedWebPartManager(PersonalizationScope.Shared);&lt;br /&gt;&lt;br /&gt;                        ConsumerConnectionPoint consumerConnection = null;&lt;br /&gt;                        foreach (ConsumerConnectionPoint point in manager.GetConsumerConnectionPoints(webPartConsumer))&lt;br /&gt;                        {&lt;br /&gt;                            if (point.InterfaceType == typeof(IFilterValues))&lt;br /&gt;                            {&lt;br /&gt;                                consumerConnection = point; break;&lt;br /&gt;                            }&lt;br /&gt;                        }&lt;br /&gt;                        ProviderConnectionPoint providerConnection = null;&lt;br /&gt;                        foreach (ProviderConnectionPoint point in manager.GetProviderConnectionPoints(webPartProvider))&lt;br /&gt;                        {&lt;br /&gt;                            if (point.InterfaceType == typeof(Microsoft.SharePoint.WebPartPages.ITransformableFilterValues))&lt;br /&gt;                            {&lt;br /&gt;                                providerConnection = point; break;&lt;br /&gt;                            }                            &lt;br /&gt;                        }&lt;br /&gt;&lt;br /&gt;                        TransformableFilterValuesToFilterValuesTransformer transformMapping = new TransformableFilterValuesToFilterValuesTransformer();&lt;br /&gt;                        transformMapping.MappedConsumerParameterName = MappingId;&lt;br /&gt;                        manager.SPConnectWebParts(webPartProvider, providerConnection, webPartConsumer, consumerConnection, transformMapping);&lt;br /&gt;&lt;br /&gt;                        oWeb.Update();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (Exception ex)&lt;br /&gt;            {&lt;br /&gt;                // exception here&lt;br /&gt;            }&lt;br /&gt;            finally&lt;br /&gt;            {&lt;br /&gt;                if (manager != null)&lt;br /&gt;                    manager.Dispose();&lt;br /&gt;&lt;br /&gt;                if (file != null)&lt;br /&gt;                {&lt;br /&gt;                    file.CheckIn("Connected web parts, if any");&lt;br /&gt;                    file.Publish("Connected web parts, if any");&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;===============================================================================&lt;br /&gt;&lt;br /&gt;this above function can be use for following points:-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Programmatically connect a Consumer WebPart &amp; a Provider WebPart&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;How to connect WebParts Programmatically?&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;Connecting webparts&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;use of ConsumerConnectionPoint and ProviderConnectionPoint &lt;br /&gt;&lt;br /&gt;or &lt;br /&gt;&lt;br /&gt;use of SPConnectWebParts&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;How to connect Web Parts programmatically in WSS 3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks&lt;br /&gt;Avinash Dad&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-4323099850074108796?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/4323099850074108796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=4323099850074108796&amp;isPopup=true' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4323099850074108796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4323099850074108796'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/08/connect-webparts-programmatically-using.html' title='Connect webparts programmatically using SPConnectWebParts'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-7854938992962974769</id><published>2010-05-03T05:21:00.000-07:00</published><updated>2010-11-12T21:32:45.100-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>How to: Pass Values Between ASP.NET Web Pages</title><content type='html'>Please refer MSDN link:-&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx"&gt;http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also refer my another article:-&lt;br /&gt;"Pass page values from one to another page in ASP .NET"&lt;br /&gt;&lt;br /&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/05/transferring-page-values-to-another.html"&gt;http://avinash-moss-expert.blogspot.com/2010/05/transferring-page-values-to-another.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Avinash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-7854938992962974769?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/7854938992962974769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=7854938992962974769&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/7854938992962974769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/7854938992962974769'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/05/how-to-pass-values-between-aspnet-web.html' title='How to: Pass Values Between ASP.NET Web Pages'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-8800106425343700129</id><published>2010-05-03T04:51:00.000-07:00</published><updated>2010-08-12T00:34:17.472-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Pass page values from one to another page in ASP .NET</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;To Pass Values Between ASP.NET Web Pages&lt;br /&gt;or&lt;br /&gt;To Transfer page values to another page&lt;br /&gt;&lt;br /&gt;we can use following:-&lt;br /&gt;&lt;br /&gt;1. Response.Redirect (Use a query string.)&lt;br /&gt;2. Cookies&lt;br /&gt;3. Session Variables&lt;br /&gt;4. Application Variables&lt;br /&gt;5. HttpContext by using Server.Transfer&lt;br /&gt;&lt;br /&gt;details:-&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br /&gt;We always come into situations in which we need to transfer values from one page to another page. In this article, I will show you some ways of transferring values from page to page. The page I created in this example is really simple which consists of a text field and a few buttons. The data entered in the text field will be transferred to another page by using different methods labeled on the buttons.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using the code&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;Response.Redirect&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;Let's first see how to transfer using Response.Redirect method. This maybe the easiest of them all. You start by writing some data in the text field, and when you finish writing the data, you press the button labeled 'Reponse.Redirect'. One tip that I would like to share with you is, sometimes we want to transfer to another page inside the catch exception, meaning exception is caught and we want to transfer to another page. If you try to do this, it may give you a System.Threading exception. This exception is raised because you are transferring to another page leaving behind the thread running. You can solve this problem using:&lt;br /&gt;&lt;br /&gt;.Redirect("WebForm5.aspx",false);This tells the compiler to go to page "WebForm5.aspx", and "false" here means that don't end what you were doing on the current page. You should also look at the System.Threading class for threading issues. Below, you can see the C# code of the button event. "txtName" is the name of the text field whose value is being transferred to a page called "WebForm5.aspx". "Name" which is just after "?" sign is just a temporary response variable which will hold the value of the text box.&lt;br /&gt;&lt;br /&gt;void Button1_Click(object sender, System.EventArgs e)&lt;br /&gt;{&lt;br /&gt;// Value sent using HttpResponse&lt;br /&gt;Response.Redirect("WebForm5.aspx?Name="+txtName.Text);&lt;br /&gt;}&lt;br /&gt;Okay, up till this point, you have send the values using Response. But now, where do I collect the values, so in the "WebForm5.aspx" page_Load event, write this code. First, we check that the value entered is not null. If it's not, then we simply display the value on the page using a Label control. Note: When you use Response.Redirect method to pass the values, all the values are visible in the URL of the browser. You should never pass credit card numbers and confidential information via Response.Redirect.&lt;br /&gt;&lt;br /&gt;(Request.QueryString["Name"]!= null)&lt;br /&gt;Label3.Text = Request.QueryString["Name"];&lt;br /&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;Cookies&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;Next up is cookies. Cookies are created on the server side but saved on the client side. In the button click event of 'Cookies', write this code:&lt;br /&gt;&lt;br /&gt;Collapse Copy CodeHttpCookie cName = new HttpCookie("Name");&lt;br /&gt;cName.Value = txtName.Text;&lt;br /&gt;Response.Cookies.Add(cName);&lt;br /&gt;Response.Redirect("WebForm5.aspx");First, we create a cookie named "cName". Since one cookie instance can hold many values, we tell the compiler that this cookie will hold "Name" value. We assign to it the value of the TextBox and finally add it in the Response stream, and sent it to the other page using Response.Redirect method.&lt;br /&gt;&lt;br /&gt;Let's see here how we can get the value of the cookie which is sent by one page.&lt;br /&gt;&lt;br /&gt;(Request.Cookies["Name"] != null )&lt;br /&gt;Label3.Text = Request.Cookies["Name"].Value;As you see, it's exactly the same way as we did before, but now we are using Request.Cookies instead of Request.QueryString. Remember that some browsers don't accept cookies.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;Session Variables&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;Next we see the session variables which are handled by the server. Sessions are created as soon as the first response is being sent from the client to the server, and session ends when the user closes his browser window or some abnormal operation takes place. Here is how you can use session variables for transferring values. Below you can see a Session is created for the user and "Name" is the key, also known as the Session key, which is assigned the TextBox value.&lt;br /&gt;&lt;br /&gt;// Session Created&lt;br /&gt;Session["Name"] = txtName.Text;&lt;br /&gt;Response.Redirect("WebForm5.aspx");&lt;br /&gt;&lt;br /&gt;// The code below shows how to get the session value.&lt;br /&gt;// This code must be placed in other page.&lt;br /&gt;if(Session["Name"] != null)&lt;br /&gt;Label3.Text = Session["Name"].ToString();&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;em&gt;Application Variables&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;Sometimes, we need to access a value from anywhere in our page. For that, you can use Application variables. Here is a small code that shows how to do that. Once you created and assigned the Application variable, you can retrieve its value anywhere in your application.&lt;br /&gt;&lt;br /&gt;// This sets the value of the Application Variable&lt;br /&gt;Application["Name"] = txtName.Text;&lt;br /&gt;Response.Redirect("WebForm5.aspx");&lt;br /&gt;&lt;br /&gt;// This is how we retrieve the value of the Application Variable&lt;br /&gt;if( Application["Name"] != null )&lt;br /&gt;Label3.Text = Application["Name"].ToString();&lt;br /&gt;&lt;span style="color:#000099;"&gt;&lt;em&gt;HttpContext&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;You can also use HttpContext to retrieve values from pages. The values are retrieved using properties or methods. It's a good idea to use properties since they are easier to code and modify. In your first page, make a property that returns the value of the TextBox.&lt;br /&gt;&lt;br /&gt;string GetName&lt;br /&gt;{&lt;br /&gt;get { return txtName.Text; }&lt;br /&gt;}We will use Server.Transfer to send the control to a new page. Note that Server.Transfer only transfers the control to the new page and does not redirect the browser to it, which means you will see the address of the old page in your URL. Simply add the following line of code in 'Server.Transfer' button click event:&lt;br /&gt;&lt;br /&gt;Server.Transfer("WebForm5.aspx");Now, let's go to the page where the values are being transferred, which in this case is "webForm5.aspx".&lt;br /&gt;&lt;br /&gt;// You can declare this Globally or in any event you like&lt;br /&gt;WebForm4 w;&lt;br /&gt;&lt;br /&gt;// Gets the Page.Context which is Associated with this page&lt;br /&gt;w = (WebForm4)Context.Handler;&lt;br /&gt;// Assign the Label control with the property "GetName" which returns string&lt;br /&gt;Label3.Text = w.GetName;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;please refer actual article at&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/aspnet/TransferingValues.aspx"&gt;http://www.codeproject.com/KB/aspnet/TransferingValues.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks &amp;amp; Regards,&lt;br /&gt;Avinash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-8800106425343700129?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/8800106425343700129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=8800106425343700129&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8800106425343700129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/8800106425343700129'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/05/transferring-page-values-to-another.html' title='Pass page values from one to another page in ASP .NET'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-1831876956159348659</id><published>2010-04-20T01:30:00.000-07:00</published><updated>2010-08-12T00:34:17.472-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Sharepoint 2007 ( MOSS ) Interview Questions</title><content type='html'>Hi All,&lt;br /&gt;&lt;br /&gt;I have few collection of sharepoint interview questions. &lt;br /&gt;Please find below:-&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;What does AllowUnsafeUpdates do ?&lt;br /&gt;If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property. C#:&lt;br /&gt;view sourceprint?&lt;br /&gt;01.using(SPSite mySite = new SPSite("yourserver")) &lt;br /&gt;02.{ using(SPWeb myWeb = mySite.OpenWeb()) &lt;br /&gt;03.{ &lt;br /&gt;04.myWeb.AllowUnsafeUpdates = true; &lt;br /&gt;05.SPList interviewList = myWeb.Lists["listtoinsert"]; &lt;br /&gt;06.SPListItem newItem = interviewList.Items.Add(); &lt;br /&gt;07.newItem["interview"] = "interview"; &lt;br /&gt;08.newItem.Update(); &lt;br /&gt;09.} &lt;br /&gt;10.}&lt;br /&gt;&lt;br /&gt;- What does RunWithElevatedPrivileges do?&lt;br /&gt;Assume that you have a Web Part in which you want to display information obtained through the Windows SharePoint Services object model, such as the name of the current site collection owner, usage statistics, or auditing information. These are examples of calls into the object model that require site-administration privileges. Your Web Part experiences an access-denied error if it attempts to obtain this information when the current user is not a site administrator. The request is initiated by a nonprivileged user. you can still successfully make these calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class. C#:&lt;br /&gt;view sourceprint?&lt;br /&gt;01.SPSite siteColl = SPContext.Current.Site; &lt;br /&gt;02.SPWeb site = SPContext.Current.Web; &lt;br /&gt;03.SPSecurity.RunWithElevatedPrivileges(delegate() &lt;br /&gt;04.{ &lt;br /&gt;05.using (SPSite ElevatedsiteColl = new SPSite(siteColl.ID)) &lt;br /&gt;06.{ &lt;br /&gt;07.using (SPWeb ElevatedSite = ElevatedsiteColl.OpenWeb(site.ID)) &lt;br /&gt;08.{ &lt;br /&gt;09.string SiteCollectionOwner = ElevatedsiteColl.Owner.Name; &lt;br /&gt;10.string Visits = ElevatedsiteColl.Usage.Visits.ToString(); &lt;br /&gt;11.string RootAuditEntries = ElevatedSite.RootFolder.Audit.GetEntries().Count.ToString(); &lt;br /&gt;12.} &lt;br /&gt;13.} &lt;br /&gt;14.});&lt;br /&gt;&lt;br /&gt;- What is a SharePoint Feature? What files are used to define a feature?&lt;br /&gt;A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances.&lt;br /&gt;Scopes include&lt;br /&gt;• Farm&lt;br /&gt;• WebApplication &lt;br /&gt;• Site (site collection)&lt;br /&gt;• Web (site)&lt;br /&gt;Features have their own receiver architecture, which allow you to trap events such as when a feature is &lt;br /&gt;• installing&lt;br /&gt;• uninstalling&lt;br /&gt;• activated&lt;br /&gt;• deactivated&lt;br /&gt;The element types that can be defined by a feature include &lt;br /&gt;• menu commands&lt;br /&gt;• link commands&lt;br /&gt;• page templates&lt;br /&gt;• page instances&lt;br /&gt;• list definitions&lt;br /&gt;• list instances&lt;br /&gt;• event handlers&lt;br /&gt;• workflows&lt;br /&gt;The two files that are used to define a feature are &lt;br /&gt;• feature.xml&lt;br /&gt;• manifest file(elements.xml)&lt;br /&gt;The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.&lt;br /&gt;Common stsadm commands associated with feature are&lt;br /&gt;• stsadm -o installfeature&lt;br /&gt;• stsadm -o uninstallfeature&lt;br /&gt;• stsadm -o activatefeature&lt;br /&gt;• stsadm -o deactivatefeature&lt;br /&gt;&lt;br /&gt;- What are content types ?&lt;br /&gt;A content type is a flexible and reusable WSS type definition that defines the columns and behavior for an item in a list or a document in a document library. &lt;br /&gt;For example, &lt;br /&gt;-you can create a content type for a customer presentation document with a unique set of columns, an event handler, and its own document template. &lt;br /&gt;-You can create a second content type for a customer proposal document with a different set of columns, a workflow, and a different document template.&lt;br /&gt;Then you can attach both the contenttypes to a document library, which allows you to capture metadata based on the contenttype selected during creation of the document.&lt;br /&gt;&lt;br /&gt;Content type can be created by the following&lt;br /&gt;• from the rootweb of a site collection, go to Site Action &gt; Site Settings &gt; Galleries &gt; Site content types&lt;br /&gt;• using a feature &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Workflow can be applied to what all elements of SharePoint ?&lt;br /&gt;While workflow associations are often created directly on lists and document libraries, a workflow association can also be created on a content type that exists within the Content Type Gallery for the current site or content types defined within a list. &lt;br /&gt;In short, it can be applied ... &lt;br /&gt;• At the level of a list (or document library)&lt;br /&gt;• At the level of a content type defined at site scope&lt;br /&gt;• At the level of a site ( Sharepoint 2010 )&lt;br /&gt;&lt;br /&gt;- What are the ways to initiate the workflow ?&lt;br /&gt;• Automatic (on item added or item deleted)&lt;br /&gt;• Manual (standard WSS UI interface)&lt;br /&gt;• Manual (Custom UI Interface)&lt;br /&gt;• Programatically through custom code&lt;br /&gt;&lt;br /&gt;7. What are the types of input forms that can be created for a workflow ?&lt;br /&gt;You can create four different types of input forms including an association form, an initiation form, a modification form, and a task edit form. Note that these forms are optional when you create a workflow template.&lt;br /&gt;&lt;br /&gt;8. What are ways to create input forms for workflow ?&lt;br /&gt;Two different approaches can be used to develop custom input forms for a WSS workflow template.&lt;br /&gt;• You can create your forms by using custom application pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath approach)&lt;br /&gt;• using Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)&lt;br /&gt;&lt;br /&gt;9. What is the difference between method activity and event activity in WF ?&lt;br /&gt;A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.&lt;br /&gt;&lt;br /&gt;10. What does SPWeb.EnsureUser method do?&lt;br /&gt;Checks whether the specified login name belongs to a valid user of the Web site, and if the login name does not already exist, adds it to the Web site. e.g SPUser usr = myWeb.EnsureUser("mmangaldas");&lt;br /&gt;&lt;br /&gt;11. While creating a Webpart, which is the ideal location to Initialize my new controls ?&lt;br /&gt;Override the CreateChildControls method to include your new controls. To make sure that the new controls are initialized.. call 'EnsureChildControls' in the webparts Render method. You can control the exact Rendering of your controls by calling the .Render method in the webparts Render method.&lt;br /&gt;&lt;br /&gt;12. How to query from multiple lists ?&lt;br /&gt;Use SPSiteDataQuery to fetch data from multiple lists. more details..&lt;br /&gt;&lt;br /&gt;13.How Does SharePoint work?&lt;br /&gt;The browser sends a DAV packet to IIS asking to perform a document check in. PKMDASL.DLL, an ISAPI DLL, parses the packet and sees that it has the proprietary INVOKE command. Because of the existence of this command, the packet is passed off to msdmserv.exe, who in turn processes the packet and uses EXOLEDB to access the WSS, perform the operation and send the results back to the user in the form of XML.&lt;br /&gt;&lt;br /&gt;14. What is the difference between Syncronous &amp; Asyncronous events?&lt;br /&gt;Syncronous calls ending with 'ing' E.g. ItemDeleting Event Handler code execute BEFORE action is committed WSS waits for code to return Option to cancel and return error code&lt;br /&gt;Asyncronous calls ending with 'ed' E.g. ItemDeleted Event Handler code executes AFTER action is committed WSS does not wait for code to return Executed in its own Worker thread.&lt;br /&gt;&lt;br /&gt;15. What is ServerUpdate() ?&lt;br /&gt;Any changes in the list, i.e. new addition or modification of an item.. the operation is complete by calling the Update method.But if a List is set to maintain versions .. and you are editing an item, but don't want to save it as a new version, then use the SystemUpdate method instead and pass in 'false' as the parameter.&lt;br /&gt;&lt;br /&gt;16. What is query.ViewAttributes OR How can you force SPQuery to return results from all the folders of the list?&lt;br /&gt;If you use SPQuery on any SPlist .. it will bring back results from the current folder only. If you want to get results from all the folders in the list.. then you need to specify the scope of the query by the use of ViewAttributes..&lt;br /&gt;e.g. query.ViewAttributes = "Scope=\"Recursive\"";&lt;br /&gt;&lt;br /&gt;- What are the two base classes a WebPart you are going to use within SharePoint 2007 can inherit from?&lt;br /&gt;There are two base classes that a WebPart which is going to be consumed by SharePoint can inherit from, either the SharePoint WebPart Base class or the ASP.NET 2.0 WebPart base class. When inheriting from the SharePoint WebPart Base class your derived WebPart class will inherit from Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0 WebPart base class your derived WebPart class will inherit from System.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to use the ASP.NET WebPart base class since the old base class is meant for backwards compatibility with previous version of SharePoint, however there are four exception when it is better to leverage functionality from the SharePoint WebPart base class:&lt;br /&gt;• Cross page connections&lt;br /&gt;• Connections between Web Parts that are outside of a Web Part zone&lt;br /&gt;• Client-side connections (Web Part Page Services Component)&lt;br /&gt;• Data caching infrastructure&lt;br /&gt;&lt;br /&gt;- What are the differences between the two base classes and what are the inherit benefits of using one over another?&lt;br /&gt;The difference is the Microsoft.SharePoint.WebPartPages.WebPart base class is meant for backward compatibility with previous versions of SharePoint. The benefit of using the SharePoint WebPart base class is it supported:&lt;br /&gt;• Cross page connections&lt;br /&gt;• Connections between Web Parts that are outside of a Web Part zone&lt;br /&gt;• Client-side connections (Web Part Page Services Component)&lt;br /&gt;• Data caching infrastructure&lt;br /&gt;ASP.NET 2.0 WebParts are generally considered better to use because SharePoint is built upon the ASP.NET 2.0 web architecture. Inheriting from the ASP.NET 2.0 base class offers you features that inherit to ASP.NET 2.0, such as embedding resources as opposed to use ClassResources for deployment of said types.&lt;br /&gt;&lt;br /&gt;- What is the GAC?&lt;br /&gt;The GAC stands for the global assembly cache. It is the machine wide code cache which will give custom binaries place into the full trust code group for SharePoint. Certain SharePoint assets, such as Feature Receivers need full trust to run correctly, and therefore are put into the GAC. You should always try to avoid deployment to the GAC as much as possible since it will possibly allow development code to do more than it was intended to do.&lt;br /&gt;&lt;br /&gt;- What is strong naming (signing) a WebPart assembly file mean?&lt;br /&gt;Signing an assembly with a strong name (a.k.a strong naming) uses a cryptographic key pair that gives a unique identity to a component that is being built. This identity can then be referred throughout the rest of the environment. In order to install assemblies into the GAC, they must be strongly named. After signing, the binary will have a public key token identifier which can be use to register the component in various other places on the server.&lt;br /&gt;&lt;br /&gt;- What are safe controls, and what type of information, is placed in that element in a SharePoint web.config file?&lt;br /&gt;When you deploy a WebPart to SharePoint, you must first make it as a safe control to use within SharePoint in the web.config file. Entries made in the safe controls element of SharePoint are encountered by the SharePointHandler object and will be loaded in the SharePoint environment properly, those not will not be loaded and will throw an error.&lt;br /&gt;In the generic safe control entry (this is general, there could be more), there is generally the Assembly name, the namespace, the public key token numeric, the typename, and the safe declaration (whether it is safe or not). There are other optional elements.&lt;br /&gt;&lt;br /&gt;- What is the CreateChildControls() method? How can you use it to do something simple like displaying a Label control?&lt;br /&gt;The CreateChildControls method in WebParts is used to notify the WebPart that there are children controls that should be output for rendering. Basically, it will add any child ASP.NET controls that are called instantiating each control with its relevant properties set, wire any relevant event handlers to the control, etc. Then the add method of the control class will add the control to the controls collection. In the relevant WebPart render method, the EnsureChildControls method can be called (or set to false if no child controls should be called) to ensure that the CreateChildControls method is run. When using CreateChildControls it implies that your WebPart contains a composition of child controls.&lt;br /&gt;In order to create something like a label control in Create, you would create a new label control using the new keyword, set the various properties of the control like Visible=True and ForeColor = Color.Red, and then use Controls.Add(myLabelControl) to add the control to the controls collection. Then you can declare EnsureChildControls in the Render method of the WebPart.&lt;br /&gt;&lt;br /&gt;- What does the RenderContents method do in an ASP.NET 2.0 WebPart?&lt;br /&gt;The render contents method will render the WebPart content to the writer, usually an HtmlTextWriter since WebParts will output to an HTML stream. RenderContents is used to tell how the controls that are going to be displayed in the WebPart should be rendered on the page.&lt;br /&gt;*** Side Question: I got asked what the difference between CreateChildControls and the RenderContents method. The CreateChildControls method is used to add controls to the WebPart, and the RenderContents method is used to tell the page framework how to render the control into HTML to display on a page.&lt;br /&gt;&lt;br /&gt;- What is the WebPartManager sealed class? What is its purpose?&lt;br /&gt;The WebPartManager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in WebPartZones. For example, the WebPartManager is responsible for the functionality that is provided when you are working with moving a WebPart from WebPartZone to WebPartZone. It is known as the “the central class of the Web Part Control Set.”&lt;br /&gt;*** Side Question: I got asked how many WebPartManager controls should be on a page. In order to have WebParts on a page there has to be just one WebPartManager control to manage all the WebParts on the page.&lt;br /&gt;&lt;br /&gt;- What is a SPSite and SPWeb object, and what is the difference between each of the objects?&lt;br /&gt;The SPSite object represents a collection of sites (site collection [a top level sites and all its subsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb object contains things like the actual content. A SPSite object contains the various subsites and the information regarding them.&lt;br /&gt;&lt;br /&gt;- How would you go about getting a reference to a site?&lt;br /&gt;view sourceprint?&lt;br /&gt;1.C#:  &lt;br /&gt;2.oSPSite = new  SPSite("http:/server"); &lt;br /&gt;3.   &lt;br /&gt;4.oSPWeb = oSPSite.OpenWeb();&lt;br /&gt;&lt;br /&gt;- What does a SPWebApplication object represent?&lt;br /&gt;The SPWebApplication objects represents a SharePoint Web Application, which essentially is an IIS virtual server. Using the class you can instigate high level operations, such as getting all the features of an entire Web Application instance, or doing high level creation operations like creating new Web Applications through code.&lt;br /&gt;&lt;br /&gt;- Would you use SPWebApplication to get information like the SMTP address of the SharePoint site?&lt;br /&gt;Yes, since this is a Web Application level setting. You would iterate through each SPWebApplication in the SPWebApplication collection, and then use the appropriate property calls (OutboundMailServiceInstance) in order to return settings regarding the mail service such as the SMTP address.&lt;br /&gt;Side Question: I got asked if there are other ways to send emails from SharePoint. The answer is yes, there is. You can use the SendMail method from the SPutility class to send simple emails, however it is not as robust as using the System.Net.Mail functionality since it doesn’t allow things like setting priorities on the email.&lt;br /&gt;&lt;br /&gt;- How do you connect (reference) to a SharePoint list, and how do you insert a new List Item?&lt;br /&gt;view sourceprint?&lt;br /&gt;01.C#:  &lt;br /&gt;02.using(SPSite mySite = new SPSite("yourserver")) &lt;br /&gt;03.{ &lt;br /&gt;04.using(SPWeb myWeb = mySite.OpenWeb()) &lt;br /&gt;05.{ &lt;br /&gt;06.SPList interviewList = myWeb.Lists["listtoinsert"]; &lt;br /&gt;07.SPListItem newItem = interviewList.Items.Add(); &lt;br /&gt;08.   &lt;br /&gt;09.newItem["interview"] = "interview"; &lt;br /&gt;10.newItem.Update(); &lt;br /&gt;11.} &lt;br /&gt;12.}&lt;br /&gt;&lt;br /&gt;- How would you loop using SPList through all SharePont List items, assuming you know the name (in a string value) of the list you want to iterate through, and already have all the site code written?&lt;br /&gt;view sourceprint?&lt;br /&gt;1.C#:  &lt;br /&gt;2.SPList interviewList = myWeb.Lists["listtoiterate"]; &lt;br /&gt;3.foreach (SPListItem interview  in interviewList) &lt;br /&gt;4.{ &lt;br /&gt;5.// Do Something &lt;br /&gt;6.}&lt;br /&gt;&lt;br /&gt;- How do you return SharePoint List items using SharePoint web services?&lt;br /&gt;In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.&lt;br /&gt;Side Question: I got asked how I built queries with the lists.asmx web service. In order to build queries with this service, one of the parameters that the GetListItems method exposes is the option to build a CAML query. There are other ways to do this as well, but that was how I answered it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- What is the difference between an Internet and an intranet site?&lt;br /&gt;An internet site is a normal site that anyone on the internet can access (e.g., www.msn.com, www.microsoft.com, etc.). You can set up a site for your company that can be accessed by anyone without any user name and password.&lt;br /&gt;An intranet (or internal network), though hosted on the Web, can only be accessed by people who are members of the network. They need to have a login and password that was assigned to them when they were added to the site by the site administrator&lt;br /&gt;&lt;br /&gt;- What are the various kinds of roles the users can have?&lt;br /&gt;A user can be assigned one of the following roles&lt;br /&gt;• Reader - Has read-only access to the Web site.&lt;br /&gt;• Contributor - Can add content to existing document libraries and lists.&lt;br /&gt;• Web Designer - Can create lists and document libraries and customize pages in the Web site.&lt;br /&gt;• Administrator - Has full control of the Web site.&lt;br /&gt;&lt;br /&gt;- How customizable is the user-to-user access?&lt;br /&gt;User permissions apply to an entire Web, not to documents themselves. However, you can have additional sub webs that can optionally have their own permissions. Each user can be given any of four default roles. Additional roles can be defined by the administrator.&lt;br /&gt;Can each user have access to their own calendar?&lt;br /&gt;Yes there are two ways to do this,&lt;br /&gt;• by creating a calendar for each user, or&lt;br /&gt;• by creating a calendar with a view for each user&lt;br /&gt;&lt;br /&gt;- Can SharePoint be linked to a SQL database?&lt;br /&gt;This is possible via a custom application, but it not natively supported by SharePoint or SQL Server.&lt;br /&gt;&lt;br /&gt;- What does partial trust mean the Web Part developer?&lt;br /&gt;If an assembly is installed into the BIN directory, the code must be ensured that provides error handling in the event that required permissions are not available. Otherwise, unhandled security exceptions may cause the Web Part to fail and may affect page rendering on the page where the Web Part appears&lt;br /&gt;&lt;br /&gt;- How can I raise the trust level for assemblies installed in the BIN directory?&lt;br /&gt;Windows SharePoint Services can use any of the following three options from ASP.NET and the CLR to provide assemblies installed in the BIN directory with sufficient permissions. The following table outlines the implications and requirements for each option.&lt;br /&gt;Option Pros Cons&lt;br /&gt;Increase the trust level for the entire virtual server. For more information, see "Setting the trust level for a virtual server" Easy to implement.&lt;br /&gt;In a development environment, increasing the trust level allows you to test an assembly with increased permissions while allowing you to recompile assemblies directly into the BIN directory without resetting IIS. This option is least secure.&lt;br /&gt;This option affects all assemblies used by the virtual server.&lt;br /&gt;&lt;br /&gt;There is no guarantee the destination server has the required trust level. Therefore, Web Parts may not work once installed on the destination server.&lt;br /&gt;Create a custom policy file for your assemblies. For more information, see "How do I create a custom policy file?" Recommended approach.&lt;br /&gt;This option is most secure.&lt;br /&gt;&lt;br /&gt;An assembly can operate with a unique policy that meets the minimum permission requirements for the assembly.&lt;br /&gt;&lt;br /&gt;By creating a custom security policy, you can ensure the destination server can run your Web Parts. Requires the most configuration of all three options.&lt;br /&gt;Install your assemblies in the GAC Easy to implement.&lt;br /&gt;This grants Full trust to your assembly without affecting the trust level of assemblies installed in the BIN directory. This option is less secure.&lt;br /&gt;Assemblies installed in the GAC are available to all virtual servers and applications on a server running Windows SharePoint Services. This could represent a potential security risk as it potentially grants a higher level of permission to your assembly across a larger scope than necessary&lt;br /&gt;&lt;br /&gt;In a development environment, you must reset IIS every time you recompile assemblies.&lt;br /&gt;&lt;br /&gt;Licensing issues may arise due to the global availability of your assembly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items?&lt;br /&gt;In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.NetworkCredential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.&lt;br /&gt;*** Side Question: I got asked when you should state the credentials in code. You must state the credentials you are going to pass to the web service before you call any of the methods of the web service, otherwise the call will fail.&lt;br /&gt;&lt;br /&gt;- What is CAML, and why would you use it?&lt;br /&gt;CAML stands for Collaborative Application Markup Language. CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning. CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.&lt;br /&gt;&lt;br /&gt;- What is impersonation, and when would you use impersonation?&lt;br /&gt;Impersonation can basically provide the functionality of executing something in the context of a different identity, for example assigning an account to users with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that wouldn’t be able to access or execute something.&lt;br /&gt;&lt;br /&gt;- What is the IDesignTimeHtmlProvider interface, and when can you use it in WebParts?&lt;br /&gt;The IDesignTimeHtmlProvider interface uses the function GetDesignTimeHtml() which can contain your relevant render methods. It was helpful to use in 2003 since it allowed your WebPart to have a preview while a page was edited in FrontPage with the Webpart on it, because the GetDesignTimeHtml() method contains the HTML for the designer to render.&lt;br /&gt;&lt;br /&gt;- What are WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?&lt;br /&gt;WebPart properties are just like ASP.NET control properties, they are used to interact with and specify attributes that should be applied to a WebPart by a user. Some of the attributes you see with ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable. Although most of these properties come from the System.Web.UI.WebControls.WebParts class, ones like Category come out of System.ComponentModel namespace.&lt;br /&gt;&lt;br /&gt;- Why are properties important in WebPart development, and how have you exploited them in past development projects? What must each custom property have?&lt;br /&gt;Properties are important because WebParts allow levels of personalization for each user. WebPart properties make it possible for a user to interact, adjust, and increase overall experience value with the programmatic assets that you develop without having the need to use an external editor or right any code. A very simple example of exploiting a property would be something like allowing the user to change the text on the WebPart design interface so that they can display whatever string of text they desire.&lt;br /&gt;Each custom property that you have must have the appropriate get and set accessor methods.&lt;br /&gt;&lt;br /&gt;- What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?&lt;br /&gt;ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.&lt;br /&gt;&lt;br /&gt;- What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacy development? What does it contain?&lt;br /&gt;A SharePoint solution file is essentially a .cabinet file with all a developers ustom componets suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is is that a solution:&lt;br /&gt;allows deployment to all WFE’s in a farm&lt;br /&gt;is highly manageable from the interface allowing deployment, retraction, and versioning&lt;br /&gt;Can package all types of assets like site definitions, feature definitions (and associated components), Webparts, etc.&lt;br /&gt;Can provide Code Access Security provisioning to avoid GAC deployments&lt;br /&gt;Just to name a few things…&lt;br /&gt;&lt;br /&gt;- What is a .ddf file and what does it have to do with SharePoint Solution creation?&lt;br /&gt;A .ddf file is a data directive file and is used when building the SharePoint solution bundle specifying the source files and their destination locations. The important thing for someone to understand is that the .ddf file will be passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution file.&lt;br /&gt;&lt;br /&gt;- What file does a SharePoint solution package use to orchestrate (describe) its packaged contents?&lt;br /&gt;The solution Manifest.XML file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?&lt;br /&gt;SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.&lt;br /&gt;&lt;br /&gt;- What is a SharePoint Feature? What files are used to define a feature?&lt;br /&gt;A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, such as at the farm, site collection, web, etc. Features have their own receiver architecture, which allow you to trap events such as when a feature is installing, uninstalling, activated, or deactivated. They are helpful because they allow ease of upgrades and versioning.&lt;br /&gt;The two files that are used to define a feature are the feature.xml and manifest file. The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.&lt;br /&gt;Side Question: I got asked how the introduction of features has changed the concept of site definitions. SharePoint features are important when understanding the architecture of site definitions, since the ONET.XML file has been vastly truncated since it has several feature stapled on it.&lt;br /&gt;&lt;br /&gt;- What types of SharePoint assets can be deployed with a SharePoint feature?&lt;br /&gt;Features can do a lot. For example, you could deploy&lt;br /&gt;• Simple site customizations&lt;br /&gt;• Custom site navigation&lt;br /&gt;• WebParts&lt;br /&gt;• pages&lt;br /&gt;• list types&lt;br /&gt;• list instances&lt;br /&gt;• event handlers&lt;br /&gt;• workflows&lt;br /&gt;• custom actions&lt;br /&gt;&lt;br /&gt;- What are event receivers?&lt;br /&gt;Event receivers are classes that inherit from the SpItemEventReciever or SPListEventReciever base class (both of which derive out of the abstract base class SPEventRecieverBase), and provide the option of responding to events as they occur within SharePoint, such as adding an item or deleting an item.&lt;br /&gt;&lt;br /&gt;- When would you use an event receiver?&lt;br /&gt;Since event receivers respond to events, you could use a receiver for something as simple as canceling an action, such as deleting a document library by using the Cancel property. This would essentially prevent users from deleting any documents if you wanted to maintain retention of stored data.&lt;br /&gt;&lt;br /&gt;- What base class do event receivers inherit from?&lt;br /&gt;Event receivers either inherit from the SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.&lt;br /&gt;&lt;br /&gt;- If I wanted to not allow people to delete documents from a document library, how would I go about it?&lt;br /&gt;You would on the ItemDeleting event set: properties.Cancel= true.&lt;br /&gt;33) What is the difference between an asynchronous and synchronous event receivers?&lt;br /&gt;An asynchronous event occurs after an action has taken place, and a synchronous event occurs before an action has take place. For example, an asynchronous event is ItemAdded, and its sister synchronous event is ItemAdding.&lt;br /&gt;&lt;br /&gt;- How could you append a string to the title of a site when it is provisioned?&lt;br /&gt;In the OnActivated event:&lt;br /&gt;view sourceprint?&lt;br /&gt;1.SPWeb site = siteCollection.RootWeb; &lt;br /&gt;2.site.Title += "interview"; &lt;br /&gt;3.site.Update();&lt;br /&gt;&lt;br /&gt;- Can an event receiver be deployed through a SharePoint feature?&lt;br /&gt;Yes.&lt;br /&gt;&lt;br /&gt;- What is a content type?&lt;br /&gt;A content type is an information blueprint basically that can be re-used throughout a SharePoint environment for defining things like metadata and associated behaviors. It is basically an extension of a SharePoint list, however makes it portable for use throughout an instance regardless of where the instantiation occurs, ergo has location independence. Multiple content types can exist in one document library assuming that the appropriate document library settings are enabled. The content type will contain things like the metadata, listform pages, workflows, templates (if a document content type), and associated custom written functionality.&lt;br /&gt;&lt;br /&gt;- Can a content type have receivers associated with it?&lt;br /&gt;Yes, a content type can have an event receiver associated with it, either inheriting from the SPListEventReciever base class for list level events, or inheriting from the SPItemEventReciever base class. Whenever the content type is instantiated, it will be subject to the event receivers that are associated with it.&lt;br /&gt;&lt;br /&gt;- What two files are typically (this is kept generally) included when developing a content type, and what is the purpose of each?&lt;br /&gt;There is generally the main content type file that holds things like the content type ID, name, group, description, and version. There is also the ContentType.Fields file which contains the fields to include in the content type that has the ID, Type, Name, DisplayName, StaticName, Hidden, Required, and Sealed elements. They are related by the FieldRefs element in the main content type file.&lt;br /&gt;&lt;br /&gt;- What is an ancestral type and what does it have to do with content types?&lt;br /&gt;An ancestral type is the base type that the content type is deriving from, such as Document (0x0101). The ancestral type will define the metadata fields that are included with the custom content type.&lt;br /&gt;&lt;br /&gt;- Can a list definition be derived from a custom content type?&lt;br /&gt;Yes, a list definition can derive from a content type which can be seen in the schema.XML of the list definition in the element.&lt;br /&gt;&lt;br /&gt;- When creating a list definition, how can you create an instance of the list?&lt;br /&gt;You can create a new instance of a list by creating an instance.XML file.&lt;br /&gt;&lt;br /&gt;- What is a Field Control?&lt;br /&gt;Field controls are simple ASP.NET 2.0 server controls that provide the basic field functionality of SharePoint. They provide basic general functionality such as displaying or editing list data as it appears on SharePoint list pages.&lt;br /&gt;&lt;br /&gt;- What base class do custom Field Controls inherit from?&lt;br /&gt;This varies. Generally, custom field controls inherit from the Microsoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from the default field controls.&lt;br /&gt;&lt;br /&gt;- What is a SharePoint site definition? What is ghosted (uncustomized) and unghosted (customized)?&lt;br /&gt;SharePoint site definitions are the core set of functionality from which SharePoint site are built from, building from the SiteTemplates directory in the SharePoint 12 hive. Site definitions allow several sites to inherit from a core set of files on the file system, although appear to have unique pages, thereby increasing performance and allowing changes that happen to a site propagate to all sites that inherit from a site definition. Ghosted means that when SharePoint creates a new site it will reference the files in the related site definition upon site provisioning. Unghosted means that the site has been edited with an external editor, and therefore the customizations are instead stored in the database, breaking the inheritance of those files from the file system.&lt;br /&gt;&lt;br /&gt;- How does one deploy new SharePoint site definitions so that they are made aware to the SharePoint system?&lt;br /&gt;The best way to deploy site definitions in the SharePoint 2007 framework is to use a SharePoint solution file, so that the new site definition is automatically populated to all WFE’s in the SharePoint farm. &lt;br /&gt;&lt;br /&gt;- What is an ancestral type and what does it have to do with content types?&lt;br /&gt;An ancestral type is the base type that the content type is deriving from, such as Document (0x0101). The ancestral type will define the metadata fields that are included with the custom content type.&lt;br /&gt;&lt;br /&gt;- Can a list definition be derived from a custom content type?&lt;br /&gt;Yes, a list definition can derive from a content type which can be seen in the schema.XML of the list definition in the element.&lt;br /&gt;&lt;br /&gt;- When creating a list definition, how can you create an instance of the list?&lt;br /&gt;You can create a new instance of a list by creating an instance.XML file&lt;br /&gt;&lt;br /&gt;- What is a Field Control?&lt;br /&gt;Field controls are simple ASP.NET 2.0 server controls that provide the basic field functionality of SharePoint. They provide basic general functionality such as displaying or editing list data as it appears on SharePoint list pages.&lt;br /&gt;&lt;br /&gt;- What base class do custom Field Controls inherit from?&lt;br /&gt;This varies. Generally, custom field controls inherit from the Microsoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from the default field controls.&lt;br /&gt;&lt;br /&gt;- Can multiple SharePoint installs point to the same DB?&lt;br /&gt;Multiple SharePoint installs can use the same database server. Not literally the same database on that server. That server must be SQL Server 2000 or SQL Server 2005. It cannot be Oracle or another vendor.&lt;br /&gt;&lt;br /&gt;- How to create links to the mapped network drives?&lt;br /&gt;Creating links to mapped drives in WSS v3 or MOSS 2007 can be done via the new content type for .lnk files.&lt;br /&gt;&lt;br /&gt;- While creating a Web part, which is the ideal location to Initialize my new controls?&lt;br /&gt;Override the CreateChildControls method to include your new controls. You can control the exact rendering of your controls by calling the .Render method in the web parts Render method.&lt;br /&gt;&lt;br /&gt;- What is the WebPartManager sealed class? What is its purpose?&lt;br /&gt;The WebPartManager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in WebPartZones. For example, the WebPartManager is responsible for the functionality that is provided when you are working with moving a WebPart from WebPartZone to WebPartZone. It is known as the “the central class of the Web Part Control Set.”&lt;br /&gt;&lt;br /&gt;- What is a SPSite and SPWeb object, and what is the difference between each of the objects?&lt;br /&gt;The SPSite object represents a collection of sites (site collection [a top level site and all its subsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb object contains things like the actual content. A SPSite object contains the various subsites and the information regarding them.&lt;br /&gt;&lt;br /&gt;- What does a SPWebApplication object represent?&lt;br /&gt;The SPWebApplication objects represents a SharePoint Web Application, which essentially is an IIS virtual server. Using the class you can instigate high level operations, such as getting all the features of an entire Web Application instance, or doing high level creation operations like creating new Web Applications through code.&lt;br /&gt;&lt;br /&gt;- Would you use SPWebApplication to get information like the SMTP address of the SharePoint site?&lt;br /&gt;Yes, since this is a Web Application level setting. You would iterate through each SPWebApplication in the SPWebApplication collection, and then use the appropriate property calls (OutboundMailServiceInstance) in order to return settings regarding the mail service such as the SMTP address.&lt;br /&gt;&lt;br /&gt;- How do you return SharePoint List items using SharePoint web services?&lt;br /&gt;In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.&lt;br /&gt;Side Question: I got asked how I built queries with the lists.asmx web service. In order to build queries with this service, one of the parameters that the GetListItems method exposes is the option to build a CAML query. There are other ways to do this as well, but that was how I answered it.&lt;br /&gt;&lt;br /&gt;- When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items?&lt;br /&gt;In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.NetworkCredential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.&lt;br /&gt;&lt;br /&gt;- What is CAML, and why would you use it?&lt;br /&gt;CAML stands for Collaborative Application Markup Language. CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning. CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.&lt;br /&gt;&lt;br /&gt;- What is impersonation, and when would you use impersonation?&lt;br /&gt;Impersonation can basically provide the functionality of executing something in the context of a different identity, for example assigning an account to users with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that wouldn’t be able to access or execute something.&lt;br /&gt;&lt;br /&gt;- What are WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?&lt;br /&gt;WebPart properties are just like ASP.NET control properties, they are used to interact with and specify attributes that should be applied to a WebPart by a user. Some of the attributes you see with ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable. Although most of these properties come from the System.Web.UI.WebControls.WebParts class, ones like Category come out of System.ComponentModel namespace.&lt;br /&gt;&lt;br /&gt;- Why are properties important in WebPart development, and how have you exploited them in past development projects? What must each custom property have?&lt;br /&gt;Properties are important because WebParts allow levels of personalization for each user. WebPart properties make it possible for a user to interact, adjust, and increase overall experience value with the programmatic assets that you develop without having the need to use an external editor or right any code. A very simple example of exploiting a property would be something like allowing the user to change the text on the WebPart design interface so that they can display whatever string of text they desire.&lt;br /&gt;Each custom property that you have must have the appropriate get and set accessor methods.&lt;br /&gt;&lt;br /&gt;- What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?&lt;br /&gt;ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.&lt;br /&gt;&lt;br /&gt;- What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacy development? What does it contain?&lt;br /&gt;A SharePoint solution file is essentially a .cabinet file with all a developers ustom componets suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is is that a solution:&lt;br /&gt;allows deployment to all WFE’s in a farm&lt;br /&gt;is highly manageable from the interface allowing deployment, retraction, and versioning&lt;br /&gt;Can package all types of assets like site definitions, feature definitions (and associated components), Webparts, etc.&lt;br /&gt;Can provide Code Access Security provisioning to avoid GAC deployments&lt;br /&gt;And much more..&lt;br /&gt;&lt;br /&gt;- What is a .ddf file and what does it have to do with SharePoint Solution creation?&lt;br /&gt;.ddf file is a data directive file and is used when building the SharePoint solution bundle specifying the source files and their destination locations. The important thing for someone to understand is that the .ddf file will be passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution file.&lt;br /&gt;&lt;br /&gt;- What file does a SharePoint solution package use to orchestrate (describe) its packaged contents?&lt;br /&gt;The solution Manifest.XML file.&lt;br /&gt;&lt;br /&gt;- What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?&lt;br /&gt;SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.&lt;br /&gt;&lt;br /&gt;- When would you use an event receiver?&lt;br /&gt;Since event receivers respond to events, you could use a receiver for something as simple as canceling an action, such as deleting a document library by using the Cancel property. This would essentially prevent users from deleting any documents if you wanted to maintain retention of stored data.&lt;br /&gt;&lt;br /&gt;- What base class do event receivers inherit from?&lt;br /&gt;Event receivers either inherit from the SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.&lt;br /&gt;&lt;br /&gt;- If I wanted to not allow people to delete documents from a document library, how would I go about it?&lt;br /&gt;You would on the ItemDeleting event set: properties.Cancel= true.&lt;br /&gt;&lt;br /&gt;- When running with SPSecurity.RunWithElevatedPrivileges (web context) what credentials are being used?&lt;br /&gt;In a web context, this is the application pool identity. In a timer job and workflow, this will be the 'Windows SharePoint Timer Services' identity.&lt;br /&gt;&lt;br /&gt;- When should you dispose SPWeb and SPSite objects? And even more important, when not?&lt;br /&gt;You should always dispose them if you created them yourself, but not otherwise. You should never dispose SPContext.Current.Web/Site and you should normally not dispose SPWeb if IsRootWeb is true. More tricky constructs are things along the line of SPList.ParentWeb.&lt;br /&gt;Also dispose each web when iterating over SPWeb.Webs &lt;br /&gt;Also dispose SPLimitedWebPartManager's SPWeb property (.web) &lt;br /&gt;&lt;br /&gt;- What bugs have you found in SharePoint? And what did you do to work around them?&lt;br /&gt;&lt;br /&gt;- What base classes do event receivers inherit from?&lt;br /&gt;SPListEventReceiver, SPItemEventReciever, and SPWebEventReceiver inherit from the abstract base class SPEventReceiverBase.&lt;br /&gt;SPWorkflowLibraryEventReceiver inherits from SPItemEventReceiver.&lt;br /&gt;SPEmailEventReceiver inherits directly from System.Object.&lt;br /&gt;&lt;br /&gt;- What are the built in ways to backup a SharePoint install?&lt;br /&gt;A: Through the central administration and the stsadm command&lt;br /&gt;&lt;br /&gt;- (more advanced) You've created and deployed a Web Part, when you deploy to the server you get a page saying your Web Part couldn't be loaded, click here to go to the Web Part maintenance page, etc. to disable the web part. What step(s) should you take to get a stack dump from your web part instead of that error page?&lt;br /&gt;Go to the web.config file for your website and find the CallStack Attribute in the SafeControls element and set the value to true&lt;br /&gt;&lt;br /&gt;- How would you programmatically retrieve a list item?&lt;br /&gt;SPQuery and SPSiteDataQuery. Bonus points for knowledge of CrossListQueryCache, PortalSiteMapProvider. Negative points for use of foreach.&lt;br /&gt;&lt;br /&gt;- What are the data types which are supported as Lookup column in SharePoint.&lt;br /&gt;Only Single Line of Text and Calculated columns are supported as lookup columns.&lt;br /&gt;&lt;br /&gt;- how can debugging share point application and timer jobs ? with steps?&lt;br /&gt;1. build application place .dll into gac and reset iis&lt;br /&gt;2. On the Debug menu, select Attach to Process&lt;br /&gt;3. select the Show processes from all users check box.&lt;br /&gt;4. select W3W.exe and OSWTIMER.exe can attach&lt;br /&gt;5. refresh sharepoint site point break point&lt;br /&gt;&lt;br /&gt;- what is web part?&lt;br /&gt;Web Parts are the fundamental building blocks for Share Point user interface, and with them we can build and integrate many different types of applications.In share point also be create custom web part using .oscx control&lt;br /&gt;steps create custom web part&lt;br /&gt;1. create web part project copied .oscx control and build application.place .dll file in GAC .reset IIS.&lt;br /&gt;2. go 12 hive _layout folder create folder past your .oscx control&lt;br /&gt;3. go inetpub -&gt;wwwroot-&gt;wss-&gt;open Your site -&gt;web con fig-&gt;create safe control write assembly information of web part application&lt;br /&gt;4. open sharepoint site -&gt;site action-site editing-&gt;Galleries -&gt;web part-&gt;new Add your web part.&lt;br /&gt;follow few web part in WSS 3.0&lt;br /&gt;Content Editor Web Part&lt;br /&gt;Data View Web Part&lt;br /&gt;List View Web Part&lt;br /&gt;Image Web Part&lt;br /&gt;Members Web Part .&lt;br /&gt;Page Viewer Web Part&lt;br /&gt;&lt;br /&gt;- What are the advantages of SharePoint Portal Services (SPS) over SharePoint Team Services (STS)?&lt;br /&gt;harePoint Portal Services (SPS) has MUCH better document management. It has check-in, check-out, versioning, approval, publishing, subscriptions, categories, etc. STS does not have these features, or they are very scaled back. SharePoint Portal Services (SPS) has a better search engine, and can crawl multiple content sources. STS cannot. STS is easier to manage and much better for a team environment where there is not much Document Management going on. SPS is better for an organization, or where Document Management is crucial.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;• What is the relationship between Microsoft SharePoint Portal Server and Microsoft Windows Services?&lt;br /&gt;Microsoft SharePoint Products and Technologies (including SharePoint Portal Server and Windows SharePoint Services) deliver highly scalable collaboration solutions with flexible deployment and management tools. Windows SharePoint Services provides sites for team collaboration, while Share Point Portal Server connects these sites, people, and business processes-facilitating knowledge sharing and smart organizations. SharePoint Portal Server also extends the capabilities of Windows SharePoint Services by providing organizational and management tools for SharePoint sites, and by enabling teams to publish information to the entire organization.&lt;br /&gt;&lt;br /&gt;• What is a SharePoint Feature? What files are used to define a feature?&lt;br /&gt;A SharePoint Feature is a functional component that can be activated and deactivate at various scopes throughout a SharePoint instances, scope of which are defined as&lt;br /&gt;1. Farm level 2. Web Application level 3. Site level 4. Web level&lt;br /&gt;Features have their own receiver architecture, which allow you to trap events such as when a feature is&lt;br /&gt;Installing, Uninstalling, Activated, or Deactivated.&lt;br /&gt;&lt;br /&gt;The element types that can be defined by a feature include&lt;br /&gt;menu commands, link commands, page templates, page instances, list definitions, list instances,&lt;br /&gt;event handlers, and workflows.&lt;br /&gt;&lt;br /&gt;The two files that are used to define a feature are the feature.xml and manifest file(elements.xml). The feature XML file defines the actual feature and will make SharePoint aware of the installed feature. The manifest file contains details about the feature such as functionality.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;• Workflow can be applied to what all elements of SharePoint ?&lt;br /&gt;Workflow associations are often created directly on lists and libraries, a workflow association can also be created on a content type that exists within the Content Type Gallery for the current site or content types defined within a list. In short, it can be applied ...&lt;br /&gt;At the level of a list/library&lt;br /&gt;At the level of a content type defined at site scope&lt;br /&gt;At the level of a content type defined at list scope&lt;br /&gt;&lt;br /&gt;• What are the types of input forms that can be created for a workflow ?&lt;br /&gt;You can create four different types of input forms including&lt;br /&gt;1. An association form&lt;br /&gt;2. An initiation form&lt;br /&gt;3. A modification form&lt;br /&gt;4. A task edit form.&lt;br /&gt;&lt;br /&gt;Note that these forms are optional when you create a workflow template.&lt;br /&gt;&lt;br /&gt;• What are ways to create input forms for workflow ?&lt;br /&gt;Two&lt;br /&gt;1. You can create your forms by using custom application pages, which are standard .aspx pages deployed to run out of the _layouts directory. ( disadv: lot of code required when compared to Infopath approach)&lt;br /&gt;2. Using Microsoft Office InfoPath 2007 (disadv: picks up a dependenct on MOSS, i.e. it cannot run in a standalone WSS environment)&lt;br /&gt;&lt;br /&gt;• What is the difference between method activity and event activity in WorkFlow ?&lt;br /&gt;A method activity is one that performs an action, such as creating or updating a task. An event activity is one that runs in response to an action occurring.&lt;br /&gt;&lt;br /&gt;• What are content types?&lt;br /&gt;A content type is a flexible and reusable WSS type definition (or we can a template) that defines the columns and behavior for an item in a list or a document in a document library. For example, you can create a content type for a leave approval document with a unique set of columns, an event handler, and its own document template and attach it with a document library/libraries.&lt;br /&gt;• Can a content type have receivers associated with it?&lt;br /&gt;Yes, a content type can have an event receiver associated with it, either inheriting from the SPListEventReciever base class for list level events, or inheriting from the SPItemEventReciever base class. Whenever the content type is instantiated, it will be subject to the event receivers that are associated with it.&lt;br /&gt;&lt;br /&gt;• What two files are typically (this is kept generally) included when developing a content type, and what is the purpose of each?&lt;br /&gt;There is generally the main content type file that holds things like the content type ID, name, group, description, and version. There is also the ContentType.Fields file which contains the fields to include in the content type that has the ID, Type, Name, DisplayName, StaticName, Hidden, Required, and Sealed elements. They are related by the FieldRefs element in the main content type file.&lt;br /&gt;&lt;br /&gt;• What is an ancestral type and what does it have to do with content types?&lt;br /&gt;An ancestral type is the base type that the content type is deriving from, such as Document (0x0101). The ancestral type will define the metadata fields that are included with the custom content type.&lt;br /&gt;&lt;br /&gt;• Can a list definition be derived from a custom content type?&lt;br /&gt;Yes, a list definition can derive from a content type which can be seen in the schema.XML of the list definition in the element.&lt;br /&gt;&lt;br /&gt;• When creating a list definition, how can you create an instance of the list?&lt;br /&gt;You can create a new instance of a list by creating an instance.XML file&lt;br /&gt;&lt;br /&gt;• What is a Field Control?&lt;br /&gt;Field controls are simple ASP.NET 2.0 server controls that provide the basic field functionality of SharePoint. They provide basic general functionality such as displaying or editing list data as it appears on SharePoint list pages.&lt;br /&gt;&lt;br /&gt;• What base class do custom Field Controls inherit from?&lt;br /&gt;This varies. Generally, custom field controls inherit from the Microsoft.SharePoint.WebControls.BaseFieldControl namespace, but you can inherit from the default field controls.&lt;br /&gt;&lt;br /&gt;• Can multiple SharePoint installs point to the same DB?&lt;br /&gt;Multiple SharePoint installs can use the same database server. Not literally the same database on that server. That server must be SQL Server 2000 or SQL Server 2005. It cannot be Oracle or another vendor.&lt;br /&gt;&lt;br /&gt;• How to create links to the mapped network drives?&lt;br /&gt;Creating links to mapped drives in WSS v3 or MOSS 2007 can be done via&lt;br /&gt;the new content type for .lnk files.&lt;br /&gt;&lt;br /&gt;• While creating a Web part, which is the ideal location to Initialize my new controls?&lt;br /&gt;Override the CreateChildControls method to include your new controls. You can control the exact rendering of your controls by calling the .Render method in the web parts Render method.&lt;br /&gt;&lt;br /&gt;• What are the two base classes a WebPart you are going to use within SharePoint 2007 can inherit from?&lt;br /&gt;There are two base classes that a WebPart which is going to be consumed by SharePoint can inherit from, either the&lt;br /&gt;SharePoint WebPart Base class&lt;br /&gt;or the&lt;br /&gt;ASP.NET 2.0 WebPart base class.&lt;br /&gt;When inheriting from the SharePoint WebPart Base class your derived WebPart class will inherit from Microsoft.SharePoint.WebPartPages.WebPart. When inheriting from the ASP.NET 2.0 WebPart base class your derived WebPart class will inherit from System.Web.UI.WebControls.WebParts.WebPart. It is considered good practice to use the ASP.NET WebPart base class since the old base class is meant for backwards compatibility with previous version of SharePoint, however there are four exception when it is better to leverage functionality from the SharePoint WebPart base class:&lt;br /&gt;Cross page connections&lt;br /&gt;Connections between Web Parts that are outside of a Web Part zone&lt;br /&gt;Client-side connections (Web Part Page Services Component)&lt;br /&gt;Data caching infrastructure&lt;br /&gt;&lt;br /&gt;• What are the differences between the two base classes and what are the inherit benefits of using one over another?&lt;br /&gt;The difference is the Microsoft.SharePoint.WebPartPages.WebPart base class is meant for backward compatibility with previous versions of SharePoint. The benefit of using the SharePoint WebPart base class is it supported:&lt;br /&gt;Cross page connections&lt;br /&gt;Connections between Web Parts that are outside of a Web Part zone&lt;br /&gt;Client-side connections (Web Part Page Services Component)&lt;br /&gt;Data caching infrastructure&lt;br /&gt;ASP.NET 2.0 WebParts are generally considered better to use because SharePoint is built upon the ASP.NET 2.0 web architecture. Inheriting from the ASP.NET 2.0 base class offers you features that inherit to ASP.NET 2.0, such as embedding resources as opposed to use ClassResources for deployment of said types.&lt;br /&gt;&lt;br /&gt;• What is the WebPartManager sealed class? What is its purpose?&lt;br /&gt;The WebPartManager sealed class is responsible for managing everything occurring on a WebPart page, such as the WebParts (controls), events, and misc. functionality that will occur in WebPartZones. For example, the WebPartManager is responsible for the functionality that is provided when you are working with moving a WebPart from WebPartZone to WebPartZone. It is known as the “the central class of the Web Part Control Set.”&lt;br /&gt;&lt;br /&gt;• What does AllowUnsafeUpdates do ?&lt;br /&gt;If your code modifies Windows SharePoint Services data in some way, you may need to allow unsafe updates on the Web site, without requiring a security validation. You can do by setting the AllowUnsafeUpdates property.&lt;br /&gt;&lt;br /&gt;• What does RunWithElevatedPrivileges do?&lt;br /&gt;There are certain object model calls model that require site-administration privileges. To bypass access-denied error, we use RunWithElevatedPrivileges property when request is initiated by a nonprivileged user. We can successfully make calls into the object model by calling the RunWithElevatedPrivileges method provided by the SPSecurity class.&lt;br /&gt;• What does SPWeb.EnsureUser method do?&lt;br /&gt;Checks whether the specified login name belongs to a valid user of the Web site, and if the login name does not already exist, adds it to the Web site.&lt;br /&gt;e.g SPUser usr = myWeb.EnsureUser("hitenders");&lt;br /&gt;&lt;br /&gt;• What is a SPSite and SPWeb object, and what is the difference between each of the objects?&lt;br /&gt;The SPSite object represents a collection of sites (site collection [a top level site and all its subsites]). The SPWeb object represents an instance SharePoint Web, and SPWeb object contains things like the actual content. A SPSite object contains the various subsites and the information regarding them.&lt;br /&gt;&lt;br /&gt;• What does a SPWebApplication object represent?&lt;br /&gt;The SPWebApplication objects represents a SharePoint Web Application, which essentially is an IIS virtual server. Using the class you can instigate high level operations, such as getting all the features of an entire Web Application instance, or doing high level creation operations like creating new Web Applications through code.&lt;br /&gt;&lt;br /&gt;• Would you use SPWebApplication to get information like the SMTP address of the SharePoint site?&lt;br /&gt;Yes, since this is a Web Application level setting. You would iterate through each SPWebApplication in the SPWebApplication collection, and then use the appropriate property calls (OutboundMailServiceInstance) in order to return settings regarding the mail service such as the SMTP address.&lt;br /&gt;&lt;br /&gt;• How do you return SharePoint List items using SharePoint web services?&lt;br /&gt;In order to retrieve list items from a SharePoint list through Web Services, you should use the lists.asmx web service by establishing a web reference in Visual Studio. The lists.asmx exposes the GetListItems method, which will allow the return of the full content of the list in an XML node. It will take parameters like the GUID of the name of the list you are querying against, the GUID of the view you are going to query, etc.&lt;br /&gt;Side Question: I got asked how I built queries with the lists.asmx web service. In order to build queries with this service, one of the parameters that the GetListItems method exposes is the option to build a CAML query. There are other ways to do this as well, but that was how I answered it.&lt;br /&gt;&lt;br /&gt;• When retrieving List items using SharePoint Web Services, how do you specify explicit credentials to be passed to access the list items?&lt;br /&gt;In order to specify explicit credentials with a Web Service, you generally instantiate the web service, and then using the credentials properties of the Web Service object you use the System.Net.NetworkCredential class to specify the username, password, and domain that you wish to pass when making the web service call and operations.&lt;br /&gt;&lt;br /&gt;• What is CAML, and why would you use it?&lt;br /&gt;CAML stands for Collaborative Application Markup Language. CAML is an XML based language which provides data constructs that build up the SharePoint fields, view, and is used for table definition during site provisioning. CAML is responsible for rending data and the resulting HTML that is output to the user in SharePoint. CAML can be used for a variety of circumstances, overall is used to query, build and customize SharePoint based sites. A general use would be building a CAML query in a SharePoint WebPart in order to retrieve values from a SharePoint list.&lt;br /&gt;&lt;br /&gt;• What is impersonation, and when would you use impersonation?&lt;br /&gt;Impersonation can basically provide the functionality of executing something in the context of a different identity, for example assigning an account to users with anonymous access. You would use impersonation in order to access resources on behalf of the user with a different account, that normally, that wouldn’t be able to access or execute something.&lt;br /&gt;&lt;br /&gt;• What are WebPart properties, and what are some of the attributes you see when declaring WebPart properties in code?&lt;br /&gt;WebPart properties are just like ASP.NET control properties, they are used to interact with and specify attributes that should be applied to a WebPart by a user. Some of the attributes you see with ASP.NET 2.0 properties are WebDescription, WebDisplayName, Category, Personalizable, and WebBrowsable. Although most of these properties come from the System.Web.UI.WebControls.WebParts class, ones like Category come out of System.ComponentModel namespace.&lt;br /&gt;&lt;br /&gt;• Why are properties important in WebPart development, and how have you exploited them in past development projects? What must each custom property have?&lt;br /&gt;Properties are important because WebParts allow levels of personalization for each user. WebPart properties make it possible for a user to interact, adjust, and increase overall experience value with the programmatic assets that you develop without having the need to use an external editor or right any code. A very simple example of exploiting a property would be something like allowing the user to change the text on the WebPart design interface so that they can display whatever string of text they desire.&lt;br /&gt;Each custom property that you have must have the appropriate get and set accessor methods.&lt;br /&gt;&lt;br /&gt;• What are ClassResources? How do you reference and deploy resources with an ASP.NET 2.0 WebPart?&lt;br /&gt;ClassResources are used when inheriting from the SharePoint.WebPart.WebPartPages.WebPart base class, and are defined in the SharePoint solution file as things that should be stored in the wpresources directory on the server. It is a helpful directory to use in order to deploy custom images. In ASP.NET 2.0, typically things such as images are referenced by embedding them as resources within an assembly. The good part about ClassResources is they can help to eliminate recompiles to change small interface adjustments or alterations to external JavaScript files.&lt;br /&gt;&lt;br /&gt;• What is a SharePoint Solution File? How does it differ from WebPart .cab files in legacy development? What does it contain?&lt;br /&gt;A SharePoint solution file is essentially a .cabinet file with all a developers ustom componets suffixed with a .wsp extension that aids in deployment. The big difference with SharePoint solution files is is that a solution:&lt;br /&gt;allows deployment to all WFE’s in a farm&lt;br /&gt;is highly manageable from the interface allowing deployment, retraction, and versioning&lt;br /&gt;Can package all types of assets like site definitions, feature definitions (and associated components), Webparts, etc.&lt;br /&gt;Can provide Code Access Security provisioning to avoid GAC deployments&lt;br /&gt;And much more..&lt;br /&gt;&lt;br /&gt;• What is a .ddf file and what does it have to do with SharePoint Solution creation?&lt;br /&gt;A .ddf file is a data directive file and is used when building the SharePoint solution bundle specifying the source files and their destination locations. The important thing for someone to understand is that the .ddf file will be passed as a parameter to the MAKECAB utility to orchestrate construction of the SharePoint solution file.&lt;br /&gt;&lt;br /&gt;• What file does a SharePoint solution package use to orchestrate (describe) its packaged contents?&lt;br /&gt;The solution Manifest.XML file.&lt;br /&gt;&lt;br /&gt;• What deployment mechanism can you use to instigate Code Access Security attributes for your WebParts?&lt;br /&gt;SharePoint solution files can add in order to handle code access security deployment issues. This is done in the element in the SharePoint solution manifest.XML, which makes it easier to get assemblies the appropriate permissions in order to operate in the bin directory of the web application.&lt;br /&gt;&lt;br /&gt;• What are event receivers?&lt;br /&gt;Event receivers are classes that inherit from the SpItemEventReciever or SPListEventReciever base class (both of which derive out of the abstract base class SPEventRecieverBase), and provide the option of responding to events as they occur within SharePoint, such as adding an item or deleting an item.&lt;br /&gt;&lt;br /&gt;• When would you use an event receiver?&lt;br /&gt;Since event receivers respond to events, you could use a receiver for something as simple as canceling an action, such as deleting a document library by using the Cancel property. This would essentially prevent users from deleting any documents if you wanted to maintain retention of stored data.&lt;br /&gt;&lt;br /&gt;• What base class do event receivers inherit from?&lt;br /&gt;Event receivers either inherit from the SPListEventReciever base class or the SPItemEventReciever base class, both which derive from the abstract base class SPEventReceiverBase.&lt;br /&gt;&lt;br /&gt;• If I wanted to not allow people to delete documents from a document library, how would I go about it?&lt;br /&gt;You would on the ItemDeleting event set: properties.Cancel= true.&lt;br /&gt;&lt;br /&gt;• What is the difference between an asynchronous and synchronous event receivers?&lt;br /&gt;An asynchronous event occurs after an action has taken place, and a synchronous event occurs before an action has take place. For example, an asynchronous event is ItemAdded, and its sister synchronous event is ItemAdding&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-1831876956159348659?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/1831876956159348659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=1831876956159348659&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/1831876956159348659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/1831876956159348659'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/04/sharepoint-2007-moss-interview.html' title='Sharepoint 2007 ( MOSS ) Interview Questions'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-1709002788588332206</id><published>2010-04-19T05:03:00.000-07:00</published><updated>2010-11-12T21:35:59.682-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Uploading Files to SharePoint Document Library and updating any Meta data columns</title><content type='html'>refer my article:-&lt;br /&gt;&lt;br /&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/04/uploading-file-to-sharepoint-document.html"&gt;http://avinash-moss-expert.blogspot.com/2010/04/uploading-file-to-sharepoint-document.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-1709002788588332206?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/1709002788588332206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=1709002788588332206&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/1709002788588332206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/1709002788588332206'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/04/uploading-files-to-sharepoint-document.html' title='Uploading Files to SharePoint Document Library and updating any Meta data columns'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-3365669089155601942</id><published>2010-04-19T05:02:00.000-07:00</published><updated>2010-11-12T21:34:57.821-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>How to upload the files in the document library programmatically</title><content type='html'>refer my article:-&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/04/uploading-file-to-sharepoint-document.html"&gt;http://avinash-moss-expert.blogspot.com/2010/04/uploading-file-to-sharepoint-document.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-3365669089155601942?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/3365669089155601942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=3365669089155601942&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3365669089155601942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3365669089155601942'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/04/how-to-upload-files-in-document-library.html' title='How to upload the files in the document library programmatically'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-540783222822982789</id><published>2010-04-19T05:01:00.000-07:00</published><updated>2010-11-12T21:34:16.079-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>How to upload file to SharePoint document library with Object Model</title><content type='html'>refer my article:-&lt;br /&gt;&lt;br /&gt;&lt;a href="http://avinash-moss-expert.blogspot.com/2010/04/uploading-file-to-sharepoint-document.html"&gt;http://avinash-moss-expert.blogspot.com/2010/04/uploading-file-to-sharepoint-document.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-540783222822982789?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/540783222822982789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=540783222822982789&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/540783222822982789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/540783222822982789'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/04/how-to-upload-file-to-sharepoint.html' title='How to upload file to SharePoint document library with Object Model'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-3575967466572983426</id><published>2010-04-19T04:46:00.000-07:00</published><updated>2010-08-12T00:34:17.473-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Uploading file to Sharepoint document library</title><content type='html'>Uploading files to a SharePoint document library through the web UI is a fairly simple process, but did you know it’s also possible to programmatically upload a file (or string) to a document library?&lt;br /&gt;&lt;br /&gt;I am writing a generic function which upload a file into document library. It needs following parameters:-&lt;br /&gt;string textToOutput: This is string data which need to write in file&lt;br /&gt;string strDocLib: This is documnet library path like- "/DocLib/Forms/AllItems.aspx"&lt;br /&gt;string strFileName: "Report.xls" or "Report.txt"&lt;br /&gt;string strSiteUrl: "http://localhost:2100"&lt;br /&gt;&lt;br /&gt;Once you have all these parameters you can use following generic function which will upload file into document library on publishing portal or Collaboration site:-&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;        protected void UpdateFileInDocLib(string textToOutput, string strDocLib, string strFileName, string strSiteUrl)&lt;br /&gt;        {&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                string uploadPath = string.Empty;&lt;br /&gt;&lt;br /&gt;                string[] strDocLibName = strDocLib.Split('/');&lt;br /&gt;                if (String.IsNullOrEmpty(strFileName))&lt;br /&gt;                {&lt;br /&gt;                    string strDate = DateTime.Now.ToString();&lt;br /&gt;                    strDate = strDate.Replace('/', '_');&lt;br /&gt;                    strDate = strDate.Replace(':', '_');&lt;br /&gt;                    uploadPath = strSiteUrl + "/" + strDocLibName[1] + "/" + strDate + ".txt";&lt;br /&gt;                }&lt;br /&gt;                else&lt;br /&gt;                {&lt;br /&gt;                    uploadPath = strSiteUrl + "/" + strDocLibName[1] + "/" + strFileName;&lt;br /&gt;                }&lt;br /&gt;                using (SPSite baseSite = new SPSite(strSiteUrl))&lt;br /&gt;                {&lt;br /&gt;                    using (SPWeb baseWeb = baseSite.OpenWeb())&lt;br /&gt;                    {&lt;br /&gt;                        baseWeb.AllowUnsafeUpdates = true;&lt;br /&gt;                        SPFile document = null;&lt;br /&gt;                        // Convert string to bytes&lt;br /&gt;                        ASCIIEncoding encoder = new ASCIIEncoding();&lt;br /&gt;                        byte[] contents = encoder.GetBytes(textToOutput.ToString());&lt;br /&gt;                        // Insert other metadata while uploading file&lt;br /&gt;                        Hashtable htParameters = new Hashtable();&lt;br /&gt;                        htParameters[_listColumn3] = dtReportData.Rows.Count;&lt;br /&gt;&lt;br /&gt;                        if (baseWeb.GetFile(uploadPath).Exists)&lt;br /&gt;                            baseWeb.GetFile(uploadPath).Delete();&lt;br /&gt;                        // upload file&lt;br /&gt;                        document = baseWeb.Files.Add(uploadPath, contents, htParameters, true);&lt;br /&gt;                        document.CheckIn("", SPCheckinType.MajorCheckIn);&lt;br /&gt;                        document.Publish("");&lt;br /&gt;                        document.Approve("Approved by program");&lt;br /&gt;                        baseWeb.AllowUnsafeUpdates = false;&lt;br /&gt;&lt;br /&gt;                        Console.WriteLine("File uploaded successfully\n");&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            catch (SPException ex)&lt;br /&gt;            {&lt;br /&gt;                Console.WriteLine("File uploaded successfully\n");&lt;br /&gt;            }&lt;br /&gt;            catch&lt;br /&gt;            {&lt;br /&gt;            }&lt;br /&gt;        }&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;For input, If you have file rather than string then you can use following code to get bytes:-&lt;br /&gt;&lt;br /&gt;=====================================================&lt;br /&gt;string localFilename = "&lt;path to file you wish to upload&gt;";// ex. c:\temp\myFileToUpload.doc FileStream myStream = new FileStream(localFilename, FileMode.Open, FileAccess.Read);&lt;br /&gt;BinaryReader myReader = new BinaryReader(myStream);&lt;br /&gt;byte[] contents = reader.ReadBytes((int)myStream.Length);&lt;br /&gt;======================================================&lt;br /&gt;&lt;br /&gt;And rest process would be same..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;Avinash&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-3575967466572983426?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/3575967466572983426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=3575967466572983426&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3575967466572983426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3575967466572983426'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/04/uploading-file-to-sharepoint-document.html' title='Uploading file to Sharepoint document library'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-4906212130491677332</id><published>2010-03-19T01:29:00.000-07:00</published><updated>2010-08-12T00:34:17.473-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Error 5337 when Submitting Data from InfoPath 2007 to a SharePoint List</title><content type='html'>There might be two reasons:-&lt;br /&gt;&lt;br /&gt;1. security issue &lt;br /&gt;&lt;br /&gt;In infopath editor, Go to form option, set full trust and create trusted certificate. That should make it work.&lt;br /&gt;&lt;br /&gt;2. If you are using RunWithElevatedPrivilages or updating list&lt;br /&gt;&lt;br /&gt;This happens mostly when you call SPListItem.Update inside the RunWithElevatedPrivileges block. So you should&lt;br /&gt;&lt;br /&gt;•Declare your SPWeb object outside elevated block.&lt;br /&gt;•Get SPWeb object inside elevated block.&lt;br /&gt;•Use &amp; Dispose SPWeb object outside elevated block&lt;br /&gt;&lt;br /&gt;SPWeb myWeb = null;&lt;br /&gt;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;br /&gt;{&lt;br /&gt;using (SPSite mySite = new SPSite("URL"))&lt;br /&gt;{&lt;br /&gt;myWeb = mySite.RootWeb;&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;myWeb.AllowUnSafeUpdates = true;&lt;br /&gt;// using myWeb object access your list item, call update method on SPListItem&lt;br /&gt;myWeb.AllowUnSafeUpdates = false;&lt;br /&gt;myWeb.Dispose();&lt;br /&gt;&lt;br /&gt;=========================================================&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-4906212130491677332?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/4906212130491677332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=4906212130491677332&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4906212130491677332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/4906212130491677332'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/03/error-5337-when-submitting-data-from.html' title='Error 5337 when Submitting Data from InfoPath 2007 to a SharePoint List'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-3253223073904785796</id><published>2010-03-19T01:20:00.000-07:00</published><updated>2010-08-12T00:34:17.473-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Error 5337 when submitting the form</title><content type='html'>There might be two reasons:-&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;1. &lt;/span&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;security issue&lt;/span&gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In infopath editor, Go to form option, set full trust and create trusted certificate. That should make it work.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;2. &lt;strong&gt;If you are using RunWithElevatedPrivilages or updating list&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This happens mostly when you call SPListItem.Update inside the RunWithElevatedPrivileges block. So you should&lt;br /&gt;&lt;br /&gt;•Declare your SPWeb object outside elevated block.&lt;br /&gt;•Get SPWeb object inside elevated block.&lt;br /&gt;•Use &amp;amp; Dispose SPWeb object outside elevated block&lt;br /&gt;&lt;br /&gt;SPWeb myWeb = null;&lt;br /&gt;SPSecurity.RunWithElevatedPrivileges(delegate()&lt;br /&gt;{&lt;br /&gt;using (SPSite mySite = new SPSite("URL"))&lt;br /&gt;{&lt;br /&gt;myWeb = mySite.RootWeb;&lt;br /&gt;}&lt;br /&gt;});&lt;br /&gt;myWeb.AllowUnSafeUpdates = true;&lt;br /&gt;// using myWeb object access your list item, call update method on SPListItem&lt;br /&gt;myWeb.AllowUnSafeUpdates = false;&lt;br /&gt;myWeb.Dispose();&lt;br /&gt;&lt;br /&gt;===========================================================================&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-3253223073904785796?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/3253223073904785796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=3253223073904785796&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3253223073904785796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3253223073904785796'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/03/error-5337-when-submitting-form.html' title='Error 5337 when submitting the form'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-278863173264738927</id><published>2010-03-16T05:07:00.000-07:00</published><updated>2010-08-12T00:34:17.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>How to Pass / access Parameters into an InfoPath Form</title><content type='html'>&lt;span style="font-size:85%;"&gt;Parameters passed into an InfoPath form template or form, are available during the Loading event as a read-only collection of name/value pairs. In order to access these parameters you will need to write code that reads from this collection. This example uses C# and the InfoPath 2007 managed object model. Syntax for the legacy models follows. The steps below outline how to add code that access the Input Parameters passed into a form.&lt;br /&gt;&lt;br /&gt;In the InfoPath designer, click on Tools menu -&gt; Programming menu item.&lt;br /&gt;In the fly-out menu select the Loading event (will be On Load in older InfoPath versions).&lt;br /&gt;This will launch the appropriate IDE (MSE or VSTA or the Visual Studio Toolkit) with the code spit for the loading event inserted.&lt;br /&gt;Add the following code to access the input parameters ‘ID and ‘Status' used in the examples above&lt;br /&gt;&lt;br /&gt;(example is in C# using InfoPath 2007 Managed Object Model)&lt;br /&gt;public void FormEvents_Loading(object sender, LoadingEventArgs e)&lt;br /&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;   try&lt;br /&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;      if (HttpContext.Current != null)&lt;br /&gt;      {&lt;br /&gt;         if (HttpContext.Current.Request.QueryString.Count &gt; 0)&lt;br /&gt;           {&lt;br /&gt;              string strTempId = HttpContext.Current.Request.QueryString["ID"];&lt;br /&gt;              CreateNavigator().SelectSingleNode("/my:myFields/my:RequestTitle", NamespaceManager).SetValue (strTempId);&lt;br /&gt;           }&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;  catch (Exception ex)&lt;br /&gt;  {&lt;br /&gt;      //Write exception code&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;  }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-278863173264738927?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/278863173264738927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=278863173264738927&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/278863173264738927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/278863173264738927'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/03/how-to-pass-access-parameters-into.html' title='How to Pass / access Parameters into an InfoPath Form'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-3811535765418322348</id><published>2010-03-16T00:15:00.000-07:00</published><updated>2010-08-12T00:34:17.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>moving a SPD workflow to production server</title><content type='html'>&lt;strong&gt;moving a SPD workflow to production server &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There are several options for migrating the SPD workflow:&lt;br /&gt;&lt;br /&gt;1. Recreate the workflow in the new server: this option has the highest probability for success since the list options are picked specifically for the new environment but this is also the most time con-suming option.&lt;br /&gt;2. Perform a Stsadm Backup/Restore: this option works well but is harder to incorporate when you have an existing site. The overwrite options could cause issues so this option should be deployed to a new location.&lt;br /&gt;3. Create a site template file: the workflow may not work after deployment.&lt;br /&gt;4. Contend deployment can be used to move workflows. This is the most attractive solution for moving SharePoint Designer created workflows.&lt;br /&gt;The links below will give you an understanding as to what content deployment is and how to plan for it:&lt;br /&gt;http://blogs.msdn.com/sharepoint/archive/2006/05/02/588140.aspx&lt;br /&gt;http://technet.microsoft.com/en-us/library/cc263428.aspx&lt;br /&gt;Once you have content deployment setup you need to do to run a job to migrate a SPD workflow. For the Deployment Options you can use Deploy only new, changed, or deleted content.&lt;br /&gt;Hope it can help you.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Re-parenting a SharePoint Designer workflow to a different list&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This will allow you to package a workflow up as a feature and deploy and use it in multiple locations in your farm. However for simple deploy-ments you may want to stick with SharePoint Designer, if you do – read on!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;Within the same site:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;So you've got a workflow and now you want to either move it to another list or attach it to another list at the same time. The list you want to attach it to is in the same site. You would think there was a way of associated a workflow with more than one list but in fact there isn't and to some degree it's understandable. A lot of the actions you define in the workflow are specific to the library you are working with, even if you were to abstract your logic away from the list then SharePoint Designer links actions such as "Current Item" properties to the underlying list.&lt;br /&gt;So, unfortunately it's not as easy as just editing the configuration XML file:&lt;br /&gt;[workflow name].xoml.wfconfig.xml&lt;br /&gt;and pointing it at the XOML and RULES files for your existing workflow. Your workflow will almost certain-ly contain references to the original library or list, so just pointing the config file at you existing workflow will have some pretty uncertain outcomes!&lt;br /&gt;The good news is that you can use a lot of what you've already created and apply it to a new workflow, as per…&lt;br /&gt;1.Make sure the new list your working with is set up correctly (content types, columns, approval, check in /out…)&lt;br /&gt;2.In SharePoint Designer, create a blank workflow with a dummy step defined&lt;br /&gt;3.Copy the contents of your original XOML file named, [workflow name].xoml to the new XOML file that was created when you created the new workflow (use notepad) NOTE: The XOML contains all the variables and activity definitions for your workflow, but not the logic&lt;br /&gt;4.Copy the rules [workflow name].xoml.rules file contents to the new rules file NOTE: The rules file con-tains the login for if, then…else comparisons&lt;br /&gt;5.Compare your config [workflow name].xoml.wfconfig.xml file with the original config file and make relevant changes (probably just need to reference the content types created when requesting data from users)&lt;br /&gt;6.Check through the workflow and change any fields linked back to the original document library – THIS IS THE MOST LABORIOUS JOB!&lt;br /&gt;• UPDATE…ACTUALLY IT'S QUICKER AND EASIER TO OPEN THE XOML AND DO A GLOBAL SEARCH AND REPLACE LOOKING FOR THE GUID OF THE ORIGINAL LIBRARY AND REPLACING THAT WITH THE GUID OF YOUR NEW LIBRARY (GET THE GUID FROM THE URL LINKS ON THE SETTINGS PAGES, THE "AUDIENCE TARGETING SETTING' LINK IS PARTICULARLY HELPFUL!)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;To a different site:&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Your workflow is great and now everyone wants a go! You need to deploy not just within the same site but to another location in your farm&lt;br /&gt;The steps here are similar to the above, with the exception that you will have to copy all the files that are re-quired to run the original workflow to the new location. These files are usually just the ASPX pages that are run when you collect data from a user, you'll need to change the config file to associate the workflow with the files in the new location. Better still copy the files to a central location and reference them this location in both workflow's. That way you only have one set of files to keep up to date.&lt;br /&gt;After you've done this you can follow the steps above to make the necessary changes.&lt;br /&gt;Neither of these approaches is really ideal and to be honest there should be tools to make this process eas-ier, you can kind of see from the structure here that there is an app waiting to be written for this and if I have the time maybe I'll put one together. In the meantime please feel free to comment if you know of a simpler method.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Porting SharePoint Designer Workflows to Visual Studio&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In reali-ty, an SPD workflow is a Workflow Foundation XOML file that’s compiled on the fly, so this file can be opened in the Visual Studio Extensions for WF. Today, I’ll show you how to get started;).&lt;br /&gt;I’d strongly recommend having a basic understanding of how VS workflows work prior to reading this. For general information about building VS workflows, the SharePoint blog is a good place to start.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 1: Create a VS Workflow Project&lt;br /&gt;In VS, go to File &gt; New and select either a SharePoint Workflow Project (from the WSS or MOSS SDKs) or Workflow Foundation project. You will need Visual Studio Extensions for Workflow Foundation installed.&lt;br /&gt;&lt;br /&gt;Step 2: Copy the SPD .xoml and .rules files into the VS project&lt;br /&gt;&lt;br /&gt;With the new project in place, we’ll start porting the SPD xoml over to VS. First we need to extract the appropriate workflow files from SPD. To do this, open SPD and go to the Folder List. Right-click on the workflow that you want and choose the Publish Selected Files... option.&lt;br /&gt;In the Remote Web Site tab of the dialog that appears, select the File System radio button and choose a local location on your com-puter. This will create a folder called Workflows on your file system in the location specified.&lt;br /&gt;When you have these files, rename the .rules file (if you have one) from *.xoml.rules to *.rules. Then add the .xoml and .rules files to your VS project. If you double click on the .xoml file in the Solution Explorer, the WF workflow designer should open, and you should see all your SPD actions in place.&lt;br /&gt;&lt;br /&gt;Step 3: Generate a .cs file under the XOML (optional)&lt;br /&gt;&lt;br /&gt;If you want to add code behind your XOML, you’ll need a .cs file to go with it. By default, the copied XOML won’t come with this. To generate one, just bind a function to one of the activities in the designer. OnWorkflowActivated is there by default, so try typing an event handler name to its Invoke property. The .cs file created should automatically initialize the namespace and class name to match your XOML. If you don’t like the default names, change the attributes in the first line of the XOML in an XML editor before generating the file:&lt;br /&gt;&lt;ns0:rootworkflowactivitywithdata class="Namespace.ClassName"&gt;&lt;br /&gt;&lt;br /&gt;Step 4: Deploy and debug the workflow&lt;br /&gt;&lt;br /&gt;Fill out the rest of your deployment files and deploy the template as a SharePoint Feature the same way as with any VS workflow, then associate it for use. Since SPD workflows weren’t designed to be ported over, expect some kinks that you’ll have to debug through. But hopefully, the workflow provides enough of a base there to work through them, and with the ability to code, you can find some nifty workarounds;).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;References:-&lt;br /&gt;http://blogs.msdn.com/sharepointdesigner/archive/2007/07/06/porting-sharepoint-designer-workflows-to-visual-studio.aspx&lt;br /&gt;http://vspug.com/andynoon/2007/09/18/reparenting-a-workflow-to-a-different-list/&lt;br /&gt;http://sanketinfo.wordpress.com/2009/05/05/limitation-of-sharepoint-designerspd-workflow/&lt;br /&gt;&lt;br /&gt;&lt;/ns0:rootworkflowactivitywithdata&gt;&lt;?xml:namespace prefix = ns0 /&gt;&lt;ns0:rootworkflowactivitywithdata class="Namespace.ClassName"&gt;&lt;/ns0:rootworkflowactivitywithdata&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-3811535765418322348?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/3811535765418322348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=3811535765418322348&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3811535765418322348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3811535765418322348'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/03/moving-spd-workflow-to-production.html' title='moving a SPD workflow to production server'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-3708257811271706999</id><published>2010-03-16T00:13:00.000-07:00</published><updated>2010-08-12T00:34:17.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><title type='text'>Limitation of SharePoint Designer(SPD) Workflow</title><content type='html'>SharePoint Designer is good tool to start initial or basic level workflow, I am not expert and good person to point out any limitation into any software, but as per me below are some of the limitation which I felt for SharePoint Designer Workflow, I’ll also write you more description about some of the limitation in coming posts …&lt;br /&gt;&lt;br /&gt;1.We don’t have facility to send BCC email to any person from “Send an Email” actions.&lt;br /&gt;2.We can’t bind and attach more then one list into designer workflow, though there are some manual steps from where we can fulfill our requirements, but there won’t be any easy steps from interface or GUI&lt;br /&gt;3.We can’t deploy/copy our designer workflow from one server to another server like there won’t be any easy way to deploy SPD workflow from development machine to TEST and Production Server; I’ll write how to do manual steps to achieve this functionality. here is my post regarding how to deploy designer workflow …&lt;br /&gt;4.Designer Workflow don’t give us full customized editor from where we can customized our email body text, to do this, we need to write static HTML tags into email body part.&lt;br /&gt;5.We don’t write any calculation fields or formulas into Designer Workflow actions items, like I can’t extract only date from date-time column into designer workflow interface, for this I need to take one extra column into my SharePoint list and need to manipulate into designer workflow.&lt;br /&gt;6.While working in “Send an Email” action, if we add any list column from adding “Add Lookup to Body” button and if that column don’t have any values into SharePoint list, then it’s shows as ?????? instead of blank values into email body while sending emails …&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-3708257811271706999?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/3708257811271706999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=3708257811271706999&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3708257811271706999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/3708257811271706999'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/03/limitation-of-sharepoint-designerspd.html' title='Limitation of SharePoint Designer(SPD) Workflow'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-384738507277930699.post-641336177605750180</id><published>2010-03-15T00:49:00.000-07:00</published><updated>2010-08-12T00:34:17.474-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MOSS People Picker'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint People Picker'/><category scheme='http://www.blogger.com/atom/ns#' term='People Picker'/><title type='text'>Implementation of People Picker in Web parts</title><content type='html'>&lt;strong&gt;1. Introduction&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There can be applications where we may need to add people or group to a share point list. For example, there can be a list which stores the meeting details. The meeting details include meeting name, meeting date and time, attendees, meeting facilitator, etc. In this case the attendees and meeting facilitator are of the type people or group.&lt;br /&gt;People Picker is control through which we can add people or group in a share point application. The people picker control is available inbuilt when we operate through out of box for adding/editing people or group in share point lists. But, when the requirement is to include a people picker in web part, then there are certain properties and methods to be defined.&lt;br /&gt;In this paper, the different sections discussed are:&lt;br /&gt;· Declaring and assigning properties to a people picker control.&lt;br /&gt;· Obtaining the properties of value added in the control (like display name, email ID)&lt;br /&gt;· Clearing the values in a control.&lt;br /&gt;· Updating the list item with the values in the people picker control.&lt;br /&gt;· Populating the values to a people picker control from the list.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Declaration and assigning properties to People Picker.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The first step for including a people picker in a web part would be to declare an object for this control. This section discusses about the declaration and assigning properties to a people picker control. The people picker is enabled through a class called PeopleEditor. The declaration of PeopleEditor is as follows:&lt;br /&gt;//Class definitions to be included for enhancing People Picker&lt;br /&gt;using System. Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;using Microsoft.SharePoint.Portal.UserProfiles;&lt;br /&gt;using Microsoft.SharePoint.Portal.Topology;&lt;br /&gt;using Microsoft.SharePoint.Portal;&lt;br /&gt;//Declaring PeopleEditor object&lt;br /&gt;PeopleEditor ctrlpplPicker = new PeopleEditor ();&lt;br /&gt;//Defining properties of the PeopleEditor&lt;br /&gt;ctrlpplPicker.AutoPostBack = false;&lt;br /&gt;ctrlpplPicker.PlaceButtonsUnderEntityEditor = true;&lt;br /&gt;ctrlpplPicker.ID = "pplEditor";&lt;br /&gt;ctrlpplPicker.AllowEmpty = false;&lt;br /&gt;ctrlpplPicker.SelectionSet = "User, DL, SecGroup, SPGroup";&lt;br /&gt;ctrlpplPicker.MultiSelect = true;&lt;br /&gt;ctrlpplPicker.MaximumEntities = 5;&lt;br /&gt;The AutoPostBack property makes a page refresh on addition of value. It is assigned to false in order to avoid page refreshing.&lt;br /&gt;The PlaceButtonsUnderEntityEditor property decides the location of the Names and Browse buttons of the people picker. If you set it to true, the buttons are placed at the bottom right corner of the account name text box, otherwise to the right of it.&lt;br /&gt;The AllowEmpty property lets you define if the user is required to fill in a value in the people picker.&lt;br /&gt;The SelectionSet property allows you to define the set of users and groups the people picker can choose from. This set can consist of users, Active Directory distribution lists, Active Directory security groups, and SharePoint groups.&lt;br /&gt;The MultiSelect property lets you define if a user is allowed to specify multiple user accounts.&lt;br /&gt;The Maximum Entities property restricts the maximum number of people or groups to be added to the control.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. Obtaining details of the entries added in the people picker &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Once the people picker control is added in a webpart, the next task would be to resolve the entries made, obtain the details of the entries (like display name, email ID) and update those details to the list. The below function explains about obtaining details of the entries made in the people picker.&lt;br /&gt;// pplInfo is a string array which is used to hold display name and the email ID of the entries.&lt;br /&gt;//Declaring pplInfo&lt;br /&gt;String[] pplInfo = new String[2];&lt;br /&gt;pplInfo[0] = String.Empty;&lt;br /&gt;pplInfo[1] = String.Empty;&lt;br /&gt;// objEntity is an object of Picker Entity class which stores the individual entry (people or group) added in the people picker control. This object is required to obtain the details of the people or group added in the control. objPplEditor.ResolvedEntities is a property of Picker Entity which resolves the entries made in the people picker control.&lt;br /&gt;//The below for loop gets the count of number of entries made in the people picker. For every entry made, pplInfo [0] stores DisplayName and pplInfo [1] stores email ID.&lt;br /&gt;for(int i = 0; i &lt;&gt;&lt;br /&gt;{&lt;br /&gt;PickerEntity objEntity = (PickerEntity) objPplEditor.ResolvedEntities[i];&lt;br /&gt;pplInfo [0] += objEntity.EntityData["DisplayName"] + ";";&lt;br /&gt;pplInfo [1] += objEntity.EntityData["Email"] + ";";&lt;br /&gt;}&lt;br /&gt;if (pplInfo[0] != String.Empty)&lt;br /&gt;{&lt;br /&gt;pplInfo[0] = pplInfo[0].Substring(0, pplInfo[0].Length - 1);&lt;br /&gt;pplInfo[1] = pplInfo[1].Substring(0, pplInfo[1].Length - 1);&lt;br /&gt;}&lt;br /&gt;From the above coding snippet, the string array pplInfo holds the DisplayName and email ID of the entries made.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Updating people picker control values to a list item&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now we have the display name and the email ID of the entries made in people picker control in a string array pplInfo (pplInfo [0] stores Display Name and pplInfo [1] stores email ID). These values can be used to store display name and email ID in the list item.&lt;br /&gt;//Open the share point site which contains the list in which the entities of the people picker is to be updated.&lt;br /&gt;SPWeb myweb = new SPSite(siteName).OpenWeb();&lt;br /&gt;//Get the list name from the share point site. mylist is a SPList object which points to the sharepoint list in the site.&lt;br /&gt;SPList mylist = myweb.Lists[listName];&lt;br /&gt;// ‘newitem’ is a SPListItem object which points to new list item to be added to the list.&lt;br /&gt;SPListItem newitem = mylist.Items.Add();&lt;br /&gt;//The display name and Email ID of the values entered in people picker control are updated to the list as shown below. Update () is the function which is used to update the list item.&lt;br /&gt;newitem[columnName_DisplayName] = pplInfo[0];//Display name&lt;br /&gt;newitem[columnName_EmailID] = pplInfo[1];//Email ID&lt;br /&gt;newitem.Update( );&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Clearing existing entities in the control&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Once the control values are updated to the list we need to clear the control. The people editor control has property Entities.Clear( ) which clears the entries made in people picker.&lt;br /&gt;ctrlpplPicker.Entities.Clear();&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Populating values to control from the list&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;There can be a requirement where we need obtain the details of a list item from the sharepoint list and populate the obtained values to corresponding controls for viewing or editing. For example, in the case of meeting details, the attendees will be populated to people picker control, meeting name to textbox control, etc. The below section explains how the values are obtained from the list and populated to the control.&lt;br /&gt;// The string variable pplNames_List holds the display names on getting the values from the list. Every display name is separated by semi-colon (;). For example, the display names obtained from the list will be of the form Sachin (WT-01 TIS); Edwin (WT-01 Retail).&lt;br /&gt;string pplNames_List= "";&lt;br /&gt;pplNames_List= master[columnName_DisplayName].ToString();&lt;br /&gt;// pplNames holds the display name on resolving entities pplNames_List separated by semi-colon&lt;br /&gt;string[] pplNames;&lt;br /&gt;pplNames = pplNames_List.Split(';');&lt;br /&gt;//Array list holds the complete list of names to be added to the control. The People Editor has a property UpdateEntities which populates the control with the values in Array List.&lt;br /&gt;System.Collections.ArrayList pplList = new System.Collections.ArrayList();&lt;br /&gt;// For every value present in the pplNames, the PickerEntity object ‘entity’ holds the value and entity is added to pplList.&lt;br /&gt;for (int pplCounter = 0; pplCounter &lt;&gt;&lt;br /&gt;{&lt;br /&gt;PickerEntity entity = new PickerEntity();&lt;br /&gt;entity.Key = pplNames[pplCounter];&lt;br /&gt;pplList.Add(entity);&lt;br /&gt;}&lt;br /&gt;//At the end of this for loop, the Array list pplList will hold all the values retrieved from the list item for populating the control.&lt;br /&gt;//The PeopleEditor has a property UpdateEntities( ArrayList ) which populates the people picker control with the values stored in the array list.&lt;br /&gt;ctrlpplPicker.UpdateEntities(pplList);&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. References&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A. MSDN site which contains PeopleEditor class&lt;br /&gt;http://msdn2.microsoft.com/en-us/library/ms468579.aspx&lt;br /&gt;B. Explanation for PeopleEditor properties and methods. Function for resolving entities.&lt;br /&gt;http://www.lcbridge.nl/vision/2007/peoplepicker.htm&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;strong&gt;Author&lt;/strong&gt;&lt;/span&gt;:- Avinash Kumar Dad&lt;br /&gt;&lt;span style="color:#990000;"&gt;&lt;strong&gt;Location&lt;/strong&gt;&lt;/span&gt;: Hyderabad, India&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/384738507277930699-641336177605750180?l=avinash-moss-expert.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-moss-expert.blogspot.com/feeds/641336177605750180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=384738507277930699&amp;postID=641336177605750180&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/641336177605750180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/384738507277930699/posts/default/641336177605750180'/><link rel='alternate' type='text/html' href='http://avinash-moss-expert.blogspot.com/2010/03/implementation-of-people-picker-in-web.html' title='Implementation of People Picker in Web parts'/><author><name>Avinash Maheshwari</name><uri>http://www.blogger.com/profile/05930390208914073766</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='29' height='32' src='http://4.bp.blogspot.com/_DQio786MrrI/TN4lg4jkIQI/AAAAAAAABF4/JiH_Keduq3E/S220/album_Avi.jpg'/></author><thr:total>0</thr:total></entry></feed>
