<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title> Sundar Narasiman's Random Musings on .NET and SharePoint : SharePoint Development</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx</link><description>Tags: SharePoint Development</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Create secure sharepoint application page for site administrator</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/11/16/create-secure-sharepoint-application-page-for-site-administrator.aspx</link><pubDate>Tue, 17 Nov 2009 01:27:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1740118</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1740118</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/11/16/create-secure-sharepoint-application-page-for-site-administrator.aspx#comments</comments><description>&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve seen a question in msdn forum few days back, asking whether the sharepoint application page can&amp;nbsp;be accessed only by the administrator. There is a simple way to achieve this. Whenever we create the secure application page in sharepoint, we need to override the&amp;nbsp;property called RequireSiteAdministrator and return the value true. This would secure the application page in such a way that, it can be accessed only the site-administrator. Here is the code-snippet for the same.&amp;nbsp;&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; YourSampleApplicationPage : LayoutsPageBase {

  &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; RequireSiteAdministrator {
    get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;; }
  }

  &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnLoad(EventArgs e) {
    &lt;span class="rem"&gt;// any arbitrary logic goes here&lt;/span&gt;
  }
}
&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1740118" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Create a custom web part to render silverlight application</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/11/10/create-custom-web-part-to-render-the-silverlight-application.aspx</link><pubDate>Wed, 11 Nov 2009 01:44:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1738887</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1738887</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/11/10/create-custom-web-part-to-render-the-silverlight-application.aspx#comments</comments><description>&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;In my previous post, I&amp;#39;ve discussed about how to leverage the content editor web part to render the silverlight application. In this post, I&amp;#39;d be discussing the steps to create a custom web part to render the silverlight application. The custom web part that renders the silverlight application has more advantages. Because things like attributes of silverlight application can be externalized as web part properties. Moreover security can be applied while rendering silverlight application, because the custom web part has power of code-behind support, rather than content editor web part. The whole idea is to render the silverlight control programmatically inside the web parts(using createchildcontrols method) . Here are the steps mentioned below :-&lt;/p&gt;
&lt;p&gt;a)&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Import required namespace&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Add a reference to System.Web.Silverlight. &lt;/p&gt;
&lt;p&gt;using System.Web.UI.SilverlightControls;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;b)Programmatically add the script manager control to the page&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To render the silverlight control, the ScriptManager object needs to added to the Page. Override the OnLoad method of web part, add the ScriptManager control using the following code-snippet. There needs to be only one instance of ScriptManager object registered with the Page object. &lt;/p&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnLoad(EventArgs e)
        {
            &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnLoad(e);


            &lt;span class="rem"&gt;//get the script manager associated with the current page&lt;/span&gt;
            ScriptManager oscriptManager =
                  ScriptManager.GetCurrent(&lt;span class="kwrd"&gt;this&lt;/span&gt;.Page);

            &lt;span class="rem"&gt;//check whether the script manager is already registered to the page&lt;/span&gt;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (oscriptManager == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
            {
                oscriptManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; ScriptManager();
                Controls.AddAt(0, scriptManager);
            }

        }&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;c)CreateChildControls method to render silverlight application&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Override the CreateChildControls method and render the Silverlight control.&lt;/p&gt;

&lt;pre class="csharpcode"&gt; &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CreateChildControls()
        {
            &lt;span class="kwrd"&gt;base&lt;/span&gt;.CreateChildControls();

            Silverlight oSilverlight = &lt;span class="kwrd"&gt;new&lt;/span&gt; Silverlight();
            oSilverlight.ID = &amp;ldquo;SLWPID&amp;rdquo;;
            oSilverlight.Source = &amp;ldquo;&amp;sim;/ClientBin/YourSilverlightApp.xap&amp;rdquo;;
            oSilverlight.Width = Unit.Percentage(100);
            Controls.Add(oSilverlight);
        }
&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1738887" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Leverage content editor web part to render silverlight application</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/11/04/leverage-content-editor-web-part-to-render-silverlight-application.aspx</link><pubDate>Wed, 04 Nov 2009 13:11:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1737609</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1737609</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/11/04/leverage-content-editor-web-part-to-render-silverlight-application.aspx#comments</comments><description>&lt;p&gt;Silvelight can be integrated with SharePoint sites to provide richness and improve the user experience of the SharePoint sites. There are many ways to integrate the silverlight application (xap) with SharePoint sites. The first option is to leverage the content editor web part and render the silverlight application (xap) through html and JavaScript. This is the simplest way to integrate silverlight applications with SharePoint sites. The other option is to to create a custom web part that does the rendering of the silverlight application. &lt;/p&gt;
&lt;p&gt;In this blog post, I&amp;#39;d be sharing the steps to render silverlight applications by leveraging the&amp;nbsp; content editor web part.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Step1&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Go the virtual directory in IIS, corresponding to the SharePoint web application. In my case it is C:\inetpub\wwwroot\wss\VirtualDirectories\1111&lt;/p&gt;
&lt;p&gt;Create a sub-folder by name silverlight_bin under the C:\inetpub\wwwroot\wss\VirtualDirectories\1111&lt;/p&gt;
&lt;p&gt;Copy the silverlight application (xap) from the bin\debug directory of silverlight project&amp;nbsp; to the sub-folder silverlight_bin&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Step2&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Add the content editor web part to the page&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="text-decoration:underline;"&gt;Step3&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Click &amp;lsquo;Modify shared web part&amp;rsquo; and enter the following html snippet to the web part to the source editor of the content editor web part&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;object&lt;/span&gt;
  &lt;span class="attr"&gt;data&lt;/span&gt;=&amp;rdquo;&lt;span class="attr"&gt;data:application&lt;/span&gt;/&lt;span class="attr"&gt;x&lt;/span&gt;‐&lt;span class="attr"&gt;silverlight&lt;/span&gt;,&amp;rdquo;
  &lt;span class="attr"&gt;type&lt;/span&gt;=&amp;rdquo;&lt;span class="attr"&gt;application&lt;/span&gt;/&lt;span class="attr"&gt;x&lt;/span&gt;‐&lt;span class="attr"&gt;silverlight&lt;/span&gt;‐&lt;span class="attr"&gt;2&lt;/span&gt;‐&lt;span class="attr"&gt;b2&lt;/span&gt;&amp;rdquo;
  &lt;span class="attr"&gt;width&lt;/span&gt;=&amp;rdquo;&lt;span class="attr"&gt;400&lt;/span&gt;&amp;rdquo; &lt;span class="attr"&gt;height&lt;/span&gt;=&amp;rdquo;&lt;span class="attr"&gt;300&lt;/span&gt;&amp;rdquo;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;param&lt;/span&gt;
  &lt;span class="attr"&gt;name&lt;/span&gt;=&amp;rdquo;&lt;span class="attr"&gt;source&lt;/span&gt;&amp;rdquo;
  &lt;span class="attr"&gt;value&lt;/span&gt;=&amp;rdquo;/&lt;span class="attr"&gt;Silverlight_Bin&lt;/span&gt;/&lt;span class="attr"&gt;yoursilverlightapp&lt;/span&gt;.&lt;span class="attr"&gt;xap&lt;/span&gt;&amp;rdquo;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;object&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;Sometimes specifying the object tag in content editor web part may not work properly. If it does not work properly, we need create the object tags and other attributes using javascript.&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1737609" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Create unsecure application pages for sharepoint</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/10/13/create-unsecure-application-pages-for-sharepoint.aspx</link><pubDate>Tue, 13 Oct 2009 20:22:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1732214</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1732214</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/10/13/create-unsecure-application-pages-for-sharepoint.aspx#comments</comments><description>&lt;p&gt;There are times, where we need to create an application page to be accessed anonymously by the user, instead of the user signing-in and accessing the page. Here is the code-snippet to create an unsecure application page for sharepoint.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; UnsecureApplicationPage : Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase    
    &lt;span class="rem"&gt;// inherit the page from Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase instead of Microsoft.SharePoint.WebControls.LayoutsPageBase    &lt;/span&gt;
    
    {

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
        {                   
            
        }       
        

    &lt;span class="rem"&gt;//override the allow anonymous property to true&lt;/span&gt;
        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; AllowAnonymousAccess
        {
            get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;; }
        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; AllowNullWeb { get { &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;true&lt;/span&gt;; } }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnPreInit(EventArgs e)
        {
    

            SPSecurity.RunWithElevatedPrivileges(&lt;span class="kwrd"&gt;delegate&lt;/span&gt;()
            {

                &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnPreInit(e);
                Microsoft.SharePoint.SPWeb _Web = SPControl.GetContextWeb(Context);
                &lt;span class="kwrd"&gt;this&lt;/span&gt;.MasterPageFile = _Web.MasterUrl;               
            });

        }

    }&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1732214" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Create secure application page for sharepoint</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/10/13/create-secure-application-page-for-sharepoint.aspx</link><pubDate>Tue, 13 Oct 2009 19:57:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1732211</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1732211</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/10/13/create-secure-application-page-for-sharepoint.aspx#comments</comments><description>&lt;p&gt;Creating an application page for sharepoint is fairly simple and straight-forward. To make that application page secure, just do some extra steps in the code. Here is the code-snippet for creating secure application page in sharepoint&amp;nbsp;.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SampleSecurePage : Microsoft.SharePoint.WebControls.LayoutsPageBase    
        
    {


        &lt;span class="kwrd"&gt;public&lt;/span&gt; SampleSecurePage()
        {
           &lt;span class="rem"&gt;//In the constructor define rights check mode to be done on the pre-init event  &lt;/span&gt;
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.RightsCheckMode = RightsCheckModes.OnPreInit;

        }

        &lt;span class="rem"&gt;//get the permission set from spbase permission enumeration&lt;/span&gt;
        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; SPBasePermissions RightsRequired
        {
        get
        {
        SPBasePermissions permissions = &lt;span class="kwrd"&gt;base&lt;/span&gt;.RightsRequired;
        &lt;span class="kwrd"&gt;return&lt;/span&gt; permissions;
        }
        }

        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnPreInit(EventArgs e)
        {
            
            
                 &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnPreInit(e);
                 Microsoft.SharePoint.SPWeb _Web = SPControl.GetContextWeb(Context);

        &lt;span class="rem"&gt;//dynamically assign the master of the current spweb to the application page&lt;/span&gt;
                 &lt;span class="kwrd"&gt;this&lt;/span&gt;.MasterPageFile = _Web.MasterUrl;
             
             &lt;span class="kwrd"&gt;if&lt;/span&gt; (!HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    &lt;span class="rem"&gt;//re-direct the user to log-in page and authenticate&lt;/span&gt;
                    
                }                  

        }       

        
        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
        {
            &lt;span class="rem"&gt;//do some logic here             &lt;/span&gt;
            
                       
        }        
       
    }
&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1732211" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Leverage Javascript inside sharepoint web parts</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/10/07/leverage-javascript-in-sharepoint-web-parts.aspx</link><pubDate>Wed, 07 Oct 2009 17:50:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1730659</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1730659</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/10/07/leverage-javascript-in-sharepoint-web-parts.aspx#comments</comments><description>&lt;p&gt;Many a times, we&amp;#39;d find the need for leveraging the javascript in sharepoint web parts. It could be a simple requirement of opening up a pop-up window or could be&amp;nbsp; a complex requirement to invoke a web service from javascript. Here is code-snippet and steps to leverage java script inside sharepoint web parts. The crux is to embeed or register the javascript function in the PreRender event of the web part and invoke this registered javascript, from wherever desired.&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;pre class="csharpcode"&gt;//In the constructor of the web part, define a delegate of the PreRender method.
    &lt;span class="kwrd"&gt;public&lt;/span&gt; SampleWebPart()
        {
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.PreRender += &lt;span class="kwrd"&gt;new&lt;/span&gt; EventHandler(SampleWebPart_ClientScript_PreRender);


        }

        &lt;span class="preproc"&gt;#region&lt;/span&gt; register javascript methods
        
//In the delegate method of PreRender, call the another method that does the registering of javascript
        &lt;span class="rem"&gt;// Client script registration event&lt;/span&gt;
        &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SampleWebPart_ClientScript_PreRender(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, System.EventArgs e)
        {
            RegisterJavaScript();
        }


&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;//Use the RegisterClientScriptBlock method of the Page object, to register the javascript
        &lt;span class="rem"&gt;//Function will embedded script&lt;/span&gt;
        &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; RegisterJavasScript()
        {&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;            //format the string to hold the javascript  
            &lt;span class="kwrd"&gt;string&lt;/span&gt; embeedscript = &lt;span class="str"&gt;&amp;quot;   &amp;lt;script&amp;gt;&amp;quot;&lt;/span&gt; +
                                    &lt;span class="str"&gt;&amp;quot;function openNewWin(url) {&amp;quot;&lt;/span&gt; +
                                        &lt;span class="rem"&gt;//&amp;quot;var x = window.open(url, &amp;#39;mynewwin&amp;#39;, &amp;#39;width=1200,height=800&amp;#39;);&amp;quot; +&lt;/span&gt;
                                        &lt;span class="str"&gt;&amp;quot;var x = window.open(url);&amp;quot;&lt;/span&gt; +
                                        &lt;span class="str"&gt;&amp;quot;x.focus();&amp;quot;&lt;/span&gt; +
                                            &lt;span class="str"&gt;&amp;quot;} &amp;quot;&lt;/span&gt; +
                                   &lt;span class="str"&gt;&amp;quot;&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;;

            &lt;span class="kwrd"&gt;string&lt;/span&gt; OpenScriptKey = &lt;span class="str"&gt;&amp;quot;OpenNewWin&amp;quot;&lt;/span&gt;;
&lt;/pre&gt;
&lt;pre class="csharpcode"&gt;            //check whether the javascript has been already registered to the page
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (!Page.IsClientScriptBlockRegistered(OpenScriptKey))
            {
                Page.RegisterClientScriptBlock(OpenScriptKey, embeedscript);

            }

        }


&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Button1_click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, ImageClickEventArgs e)

        {

&lt;span class="rem"&gt;//invoke the javascript function that opens the application page  in new window&lt;/span&gt;
                &lt;span class="kwrd"&gt;this&lt;/span&gt;.Page.ClientScript.RegisterStartupScript(&lt;span class="kwrd"&gt;this&lt;/span&gt;.GetType(), &lt;span class="str"&gt;&amp;quot;OpenWin&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;&amp;lt;script&amp;gt;openNewWin(&amp;#39;&amp;quot;&lt;/span&gt; + url + &lt;span class="str"&gt;&amp;quot;&amp;#39;)&amp;lt;/script&amp;gt;&amp;quot;&lt;/span&gt;);                

}&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1730659" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Creating SharePoint Surveys in Publishing Portals – A Thought</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/09/11/creating-sharepoint-surveys-in-publishing-portals-a-thought.aspx</link><pubDate>Fri, 11 Sep 2009 23:09:42 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1722674</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1722674</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/09/11/creating-sharepoint-surveys-in-publishing-portals-a-thought.aspx#comments</comments><description>&lt;p&gt;In this post, I&amp;#39;m just going to deal with how to create and host surveys in the sharepoint publishing environment. I’m just putting together all the thoughts and experiencs on this area. MOSS 2007 provide the out-of-box capability of creating and hosting surveys. The Survey comes a Survey List, packaged as a part of Team Site Definition. So when we create SharePoint implementations of type Team Site, the surveys are readily available with the site-template, the administrator can just create a list of type survey and proceed from then on. However there are scenarios where we need to host survey functionality in sharepoint implementation of type Publishing Portals. Since survey list do not come with the publishing portal, we can create a feature that defines the survey list and deploy this feature to the sites created out of publishing portal. The site or site-collection administrator can activate the survey feature, that would make the way for the content authors to embed the survey functionality in publishing portals.&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; The challenging part is to make the survey working in the authoring-publishing environment. In the authoring environment the survey questions would be created. However the end users would answer the survey questions in the publishing environment.&lt;/p&gt;  &lt;p&gt; Will the content deployment job work fine if we have blank survey list in authoring and a non-empty survey response in publishing ? Yes, i tried this scenario. I tried&amp;#160; content deployment jobs whenever every user respond to a survey questions. This works fine. The CDS job does not overwrite publishing survey list with the blank survey list from authoring. &lt;/p&gt;  &lt;p&gt;The next part is to address the permissions for responding to survey and permissions for viewing survey response. Out-of-box the survey list, needs the contributor rights for the end-user to respond to the survey. If we’ve a large portal with 1000’s of users, we’d need a tool to provide the contributor permissions for each user. If we have the option of creating custom user interface (web part) for the surveys, we can address this survey security, in a different way by running the web part code with elevated privileges when it tries to submit the data to survey list. This privilege elevation is just momentary, until submitting survey response to sharepoint list. The option of run with elevated privileges gives an alternative to create a custom tool for survey list permissions.&lt;/p&gt;  &lt;p&gt;The last part is on the security for survey response. The best way to address this requirement is to host the entire survey list under a different sub-site of the portal. Provide the access to this sub-site, only for selected set of users, who want to view the survey response.&amp;#160; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1722674" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Patterns and Practices for developing sharepoint applications</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2009/09/06/patterns-and-practices-for-developing-sharepoint-applications.aspx</link><pubDate>Sun, 06 Sep 2009 14:03:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1721155</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1721155</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2009/09/06/patterns-and-practices-for-developing-sharepoint-applications.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/sundar_5F00_narasiman/5554.sharepoint-pnp.png"&gt;&lt;/a&gt;&lt;span style="font-size:small;"&gt;The patterns and practices for developing sharepoint applications has been released. This is aimed at architects and developers to aid the sharepoint development. It has &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:small;"&gt;One reference implementation addresses basic issues such as creating lists and content types. The other addresses more advanced problems such as how to integrate line of business services, how to create collaboration sites programmatically, and how to customize aspects of publishing and navigation. A library of reusable components helps you adopt techniques used in the reference implementations. The guidance discusses approaches for testing SharePoint applications, such as how to create unit tests, and documents experiences with stress and scale testing one of the reference implementations.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/sundar_5F00_narasiman/3858.sharepoint-pnp.png"&gt;&lt;img border="0" src="http://msmvps.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Blogs.Components.WeblogFiles/sundar_5F00_narasiman/3858.sharepoint-pnp.png" alt="" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1721155" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Visual Studio 2010 Tools for SharePoint Announced</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/11/13/visual-studio-2010-tools-for-sharepoint-announced.aspx</link><pubDate>Thu, 13 Nov 2008 06:38:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1653976</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1653976</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/11/13/visual-studio-2010-tools-for-sharepoint-announced.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;I got an update from &lt;strong&gt;Paul Andrew&lt;/strong&gt; that, Visual Studio 2010 Tools for SharePoint Announced was announced at Tech Ed EMEA recently. Check out Paul Andrew&amp;#39;s Blog for more details on VS 2010 Tools for SharePoint&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogs.msdn.com/pandrew/archive/2008/11/10/visual-studio-2010-tools-for-sharepoint-announced-at-teched-emea-developers-2008.aspx"&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;http://blogs.msdn.com/pandrew/archive/2008/11/10/visual-studio-2010-tools-for-sharepoint-announced-at-teched-emea-developers-2008.aspx&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1653976" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Silverlight Blueprints for SharePoint </title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/08/25/silverlight-blueprints-for-sharepoint.aspx</link><pubDate>Mon, 25 Aug 2008 07:56:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645699</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1645699</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/08/25/silverlight-blueprints-for-sharepoint.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-size:small;"&gt;Microsoft released the source code for the Silverlight Blueprints for SharePoint&amp;mdash;based on the Silverlight Beta 2 release. The Silverlight Blueprints for SharePoint provide a way for developers to better understand how to integrate Silverlight applications with SharePoint. Silverlight is an incredibly popular technology and with the increase in SharePoint adoption we&amp;rsquo;re finding an increased call for integrating technologies like Silverlight with SharePoint.&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;In this release, you&amp;rsquo;ll find five blueprint samples: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hello World &lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Media Player&lt;br /&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Slider Control&lt;br /&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Custom Navigation&lt;br /&gt;5.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Colleague Viewer&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;Included in the release are documentation for each of the samples and the source code (go to the Releases tab of the CodePlex site). Also posted to the site is an FAQ document. In the coming days and week, we&amp;rsquo;ll publish additional screen-casts and any other supporting documentation we create or that is provided to us through the developer community. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;&amp;nbsp;&lt;br /&gt;The links to get to the Silverlight Blueprints for SharePoint are: &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;a href="http://www.ssblueprints.net/sharepoint/"&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;http://www.ssblueprints.net/sharepoint/&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;&amp;nbsp;&amp;nbsp; --or direct at the CodePlex site&lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;a href="http://www.codeplex.com/SL4SP"&gt;&lt;span style="font-size:small;font-family:verdana,geneva;"&gt;http://www.codeplex.com/SL4SP&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645699" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Programmatically Create SharePoint Survey questions</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/08/14/programmatically-create-sharepoint-survey-questions.aspx</link><pubDate>Thu, 14 Aug 2008 10:56:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1644629</guid><dc:creator>lavssun</dc:creator><slash:comments>5</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1644629</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/08/14/programmatically-create-sharepoint-survey-questions.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-size:small;font-family:arial,helvetica,sans-serif;"&gt;&lt;strong&gt;Scenario&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:arial,helvetica,sans-serif;"&gt;I&amp;#39;m seeing this question &amp;quot;&lt;strong&gt;Is there way to create SharePoint Survey questions programmatically ?&amp;quot; &lt;/strong&gt;many&lt;strong&gt; &lt;/strong&gt;times in SharePoint Forums and News Groups&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:arial,helvetica,sans-serif;"&gt;&lt;/span&gt;&lt;span style="font-size:small;"&gt;
&lt;p&gt;&lt;span style="font-size:small;font-family:arial,helvetica,sans-serif;"&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;The answer is that it&amp;#39;s definitely achievable programmatically through SharePoint API&amp;#39;s. The following snippet would help.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;SPWeb web = SPControl.GetContextWeb(HttpContext.Current);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="color:#2b91af;"&gt;&lt;span style="color:#2b91af;"&gt;Guid&lt;/span&gt;&lt;/span&gt; surveyId = web.Lists.Add(&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;&amp;quot;Name of the Title&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;&amp;quot;Description of the survey&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;, SPListTemplateType.Survey);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;SPList survey = web.Lists[&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;font-family:arial,helvetica,sans-serif;"&gt;&amp;quot;Survey List Name or Id];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;string&lt;/span&gt;&lt;/span&gt; Question = &lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;&amp;quot;Question#1 for survey&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;; &lt;/span&gt;&lt;/p&gt;
&lt;span style="font-size:small;"&gt;
&lt;p&gt;
&lt;p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;StringCollection choices = &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;font-family:arial,helvetica,sans-serif;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&amp;nbsp;StringCollection();&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;choices.Add(&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;&amp;quot;first choice&amp;quot;&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;choices.Add(&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;"&gt;&amp;quot;second choice&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;choices.Add(&lt;/span&gt;&lt;span style="color:#a31515;"&gt;&lt;span style="color:#a31515;font-family:arial,helvetica,sans-serif;"&gt;&amp;quot;third choice&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;survey.Fields.Add(Question, SPFieldType.Choice, &lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;true&lt;/span&gt;&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;&lt;span style="color:#0000ff;"&gt;false&lt;/span&gt;&lt;/span&gt;, choices);&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1644629" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Rating &amp; Feedback functionality for SharePoint content</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/07/07/rating-amp-feedback-functionality-for-sharepoint-content.aspx</link><pubDate>Mon, 07 Jul 2008 06:35:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1639600</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1639600</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/07/07/rating-amp-feedback-functionality-for-sharepoint-content.aspx#comments</comments><description>&lt;p&gt;&lt;span style="font-size:x-small;font-family:arial,helvetica,sans-serif;"&gt;
&lt;p&gt;&lt;span style="font-size:10pt;color:#000000;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;I had&amp;nbsp;a customer requirement of implementing of implementing document rating / feedback functionality 6 months back. That time, we did not have any guidance for this. We did a custom development and achieved the feedback functionality for document library. I keep getting lot of queries in SharePoint forums for how to achieve this functionality.&lt;/span&gt;&lt;span style="font-size:7.5pt;color:#000000;font-family:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;font size="2" face="arial,helvetica,sans-serif" style="font-size:x-small;"&gt;
&lt;p&gt;&lt;span style="font-size:10pt;color:#000000;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Recently I came to know that there is a codeplex project for the same. This would be really helpful and please check this out.&lt;/span&gt;&lt;/p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;span style="font-size:x-small;font-family:arial,helvetica,sans-serif;"&gt;&lt;a href="http://www.codeplex.com/spdocrating"&gt;http://www.codeplex.com/spdocrating&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;font-family:arial,helvetica,sans-serif;"&gt;&lt;img src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/sundar_5F00_narasiman/stars.JPG" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;font-family:arial,helvetica,sans-serif;"&gt;&lt;img src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/sundar_5F00_narasiman/comments.JPG" alt="" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1639600" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Use Data View web part without unghosting the page</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/06/24/use-data-view-web-part-without-unghosting-the-page.aspx</link><pubDate>Tue, 24 Jun 2008 10:08:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1637200</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1637200</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/06/24/use-data-view-web-part-without-unghosting-the-page.aspx#comments</comments><description>&lt;p align="left"&gt;&lt;font face="verdana,geneva" size="2"&gt;&lt;strong&gt;I&amp;#39;m wondering if it&amp;#39;s possible to use the data view web part available in sharepoint designer on a page without having to&amp;nbsp;customize &amp;nbsp;or &amp;#39;unghost&amp;#39; the page?&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;font face="verdana,geneva" size="2"&gt;Yes,&amp;nbsp;this is feasible and check the following steps&lt;/font&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;font face="verdana,geneva" size="2"&gt;1. Create a sample web part page and add the dataview web part through sharepoint designer. &lt;/font&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;font face="verdana,geneva" size="2"&gt;2. Now the sample web part page is unghosted. Export the web part from this web part page&lt;/font&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;font face="verdana,geneva" size="2"&gt;3. Delete the sample web part page&lt;/font&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;font face="verdana,geneva" size="2"&gt;4. Create a new web part page and import the web part&lt;/font&gt;&lt;/p&gt;
&lt;p align="left"&gt;&lt;font face="verdana,geneva" size="2"&gt;This way&amp;nbsp;we can &lt;strong&gt;leverage the data-view web part without unghosting (or) customizing)&amp;nbsp;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1637200" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Visual Studio extensions for SharePoint - Developer User Guide</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/05/13/visual-studio-extensions-for-sharepoint-developer-user-guide.aspx</link><pubDate>Tue, 13 May 2008 13:29:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1621835</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1621835</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/05/13/visual-studio-extensions-for-sharepoint-developer-user-guide.aspx#comments</comments><description>&lt;p class="MsoNormal"&gt;&lt;a class="" rel="nofollow" name="_MailEndCompose"&gt;&lt;/a&gt;&lt;font face="comic sans ms,sand" color="#003399" size="2"&gt;The &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=A8A4E775-074D-4451-BE39-459921F79787&amp;amp;displaylang=en" target="_blank" rel="nofollow"&gt;&lt;span class="yshortcuts" id="lw_1210685199_0" style="BACKGROUND:none transparent scroll repeat 0% 0%;"&gt;&lt;font face="comic sans ms,sand" color="#003399" size="2"&gt;User Guide, Samples and Walkthroughs&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;font face="comic sans ms,sand" size="2"&gt; for &lt;/font&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=3E1DCCCD-1CCA-433A-BB4D-97B96BF7AB63&amp;amp;displaylang=en" target="_blank" rel="nofollow"&gt;&lt;span class="yshortcuts" id="lw_1210685199_1"&gt;&lt;font face="comic sans ms,sand" color="#003399" size="2"&gt;the Visual Studio 2005 extensions for Windows SharePoint Services 3.0, v1.1&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;font face="comic sans ms,sand" size="2"&gt; has been released. The &lt;span class="yshortcuts" id="lw_1210685199_2" style="BACKGROUND:none transparent scroll repeat 0% 0%;CURSOR:hand;BORDER-BOTTOM:#0066cc 1px dashed;"&gt;Visual Studio 2005&lt;/span&gt; extensions for SharePoint were released back in Feb 2008 and an update for &lt;span class="yshortcuts" id="lw_1210685199_3" style="CURSOR:hand;BORDER-BOTTOM:#0066cc 1px dashed;"&gt;Visual Studio&lt;/span&gt; 2008 is planned for release in June 2008.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="comic sans ms,sand" size="2"&gt;The user guide represents approx 200 pages of documentation applicable to both the 2005 and the 2008 release of the &lt;span class="yshortcuts" id="lw_1210685199_4" style="CURSOR:hand;BORDER-BOTTOM:#0066cc 1px dashed;"&gt;Visual Studio&lt;/span&gt; extensions for SharePoint. The user guide contains an introduction to using the &lt;span class="yshortcuts" id="lw_1210685199_5" style="CURSOR:hand;BORDER-BOTTOM:#0066cc 1px dashed;"&gt;Visual Studio&lt;/span&gt; extensions for SharePoint, and it contains walkthrough samples for each of the project templates that are supplied with the &lt;span class="yshortcuts" id="lw_1210685199_6" style="CURSOR:hand;BORDER-BOTTOM:#0066cc 1px dashed;"&gt;Visual Studio&lt;/span&gt; extensions for SharePoint. These are the document sections:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;1.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;Starting out in SharePoint Development&lt;/b&gt;&lt;br /&gt;An introductory guide. &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;2.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;Walkthrough of the VSeWSS User Interface including the WSP View&lt;/b&gt; &lt;br /&gt;A description of the user interface elements. The WSP view is a new tool panel which helps you put together the deployment package for SharePoint projects.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;3.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;The Team Site Project&lt;/b&gt; &lt;br /&gt;A walkthrough and complete sample.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;4.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;The Blank Site Project&lt;/b&gt; &lt;br /&gt;A walkthrough and complete sample.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;5.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;The List Definition Project&lt;/b&gt; &lt;br /&gt;A walkthrough and complete sample.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;6.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;The Web Part Project&lt;/b&gt; &lt;br /&gt;A walkthrough and complete sample.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;7.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;The Workflow Projects&lt;/b&gt; &lt;br /&gt;A walkthrough and complete sample for each of Sequential and State machine workflows. Although these project templates are not shipped with VSeWSS we added them for completeness. They are included in &lt;span class="yshortcuts" id="lw_1210685199_7" style="CURSOR:hand;BORDER-BOTTOM:#0066cc 1px dashed;"&gt;Visual Studio&lt;/span&gt; 2008 and are available for &lt;span class="yshortcuts" id="lw_1210685199_8" style="CURSOR:hand;BORDER-BOTTOM:#0066cc 1px dashed;"&gt;Visual Studio 2005&lt;/span&gt; in the Windows SharePoint Services SDK.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;8.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;Project Item Templates&lt;/b&gt; &lt;br /&gt;A description and usage for each of the project item templates. Essentially the project templates are largely empty templates with default project items contained.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;9.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;Best Practices with VSeWSS&lt;/b&gt; &lt;br /&gt;A collection of suggestions for working with the tool.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraph"&gt;&lt;font face="comic sans ms,sand"&gt;&lt;font size="2"&gt;&lt;span&gt;10.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;b&gt;Changes from 1.0 to 1.1&lt;/b&gt;&lt;br /&gt;A list of what was improved. There were lots of improvements from V1.0 of VSeWSS&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1621835" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Web Part Life Cycle Events</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/02/14/web-part-life-cycle-events.aspx</link><pubDate>Thu, 14 Feb 2008 12:18:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1514160</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1514160</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/02/14/web-part-life-cycle-events.aspx#comments</comments><description>&lt;p&gt;There are various web part events in the life-cycle. The following would shed some light to these events and help us to choose these events correctly based on the needs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;OnPreRender&lt;/b&gt;- It is called logically called before Render event of the ASP.NET page. This is the last opportunity for us to affect the rendering behavior of the web part page. Things like changes to the viewstate properties can be done logically in the OnPreRender event. &amp;nbsp;&amp;nbsp;Moreover the &lt;b&gt;OnPreRender&lt;/b&gt;&amp;nbsp; event is called logically after the events &lt;b&gt;EnsureChildControls&lt;/b&gt; and &lt;b&gt;CreateChildControls&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;CreateChildControls: &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;If we need to render the ASP.NET web server controls (ike button, text box etc) in the web part, this event needs to be overridden. Logically we can add web controls and wire the events to it &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Render &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This event is used logically to control the rendering behavior of the web part. There is already a default implementation of Render method. We need not always override Render method for certain cases like CreateChildControls method having the logic to add controls. &lt;b&gt;Render&lt;/b&gt; method can also be used to render html stream (directly) and ASP.NET web server controls &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Render Control&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This method can be called inside the overridden &lt;b&gt;Render&lt;/b&gt; method to render the ASP.NET web server controls like button, textbox etc...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Render Contents&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;RenderContents gives power to render the html streams directly inside the overridden&lt;b&gt; Render &lt;/b&gt;method. The RenderContents should be preceded by &lt;b&gt;RenderBeginTag a&lt;/b&gt;nd the &lt;b&gt;RenderContents &lt;/b&gt;should&lt;b&gt; &lt;/b&gt;be followed &lt;b&gt;RenderEndTag&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1514160" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item><item><title>Connected Page Viewer Web Part</title><link>http://msmvps.com/blogs/sundar_narasiman/archive/2008/02/13/connected-page-viewer-web-part.aspx</link><pubDate>Wed, 13 Feb 2008 06:23:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1511917</guid><dc:creator>lavssun</dc:creator><slash:comments>0</slash:comments><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/sundar_narasiman/commentapi.aspx?PostID=1511917</wfw:comment><comments>http://msmvps.com/blogs/sundar_narasiman/archive/2008/02/13/connected-page-viewer-web-part.aspx#comments</comments><description>&lt;p&gt;&lt;b&gt;Scenario:-&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;There is a Link web part and a Page viewer web part on the web part page. The requirement is that, whenever a user clicks on a particular link inside Link Web Part it should automatically render the corresponding page inside the page viewer web part. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Challenges:-&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;By default the page viewer web part does not support connections. &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Solution:-&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The solution is to create a page viewer web part that accepts the url as the connectable parameter. There is an interesting post by Todd Baginski about creating a connectable Page Viewer Web Part&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.sharepointblogs.com/tbaginski/archive/2007/08/16/connected-page-viewer-web-part.aspx"&gt;http://www.sharepointblogs.com/tbaginski/archive/2007/08/16/connected-page-viewer-web-part.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Even though the code-sample mentioned in the above link is for SPS 2003,&amp;nbsp;we need to do&amp;nbsp;code changes if we are developing it for WSS 3.0 / MOSS 2007. Probably if we are developing the web part as &amp;quot;&lt;strong&gt;SharePoint web part&lt;/strong&gt;&amp;quot; the code changes we&amp;#39;d be making is less, compared to developing it as &amp;quot;&lt;strong&gt;ASP.NET&amp;quot; web parts&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;d try this developing it for WSS 3.0/ MOSS 2007 and share my experiences&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1511917" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/sundar_narasiman/archive/tags/SharePoint+Development/default.aspx">SharePoint Development</category></item></channel></rss>