<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nishant Rana&#039;s Weblog &#187; MOSS</title>
	<atom:link href="http://nishantrana.wordpress.com/category/moss/feed/" rel="self" type="application/rss+xml" />
	<link>http://nishantrana.wordpress.com</link>
	<description>Everything related to Microsoft .NET technology</description>
	<lastBuildDate>Tue, 08 Dec 2009 09:08:15 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='nishantrana.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/7096194784cd6b5dc462bb0515e43296?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Nishant Rana&#039;s Weblog &#187; MOSS</title>
		<link>http://nishantrana.wordpress.com</link>
	</image>
			<item>
		<title>JavaScript on click of Finish Button in Survey &#8211; SharePoint</title>
		<link>http://nishantrana.wordpress.com/2009/06/30/javascript-on-click-of-finish-button-in-survey-sharepoint/</link>
		<comments>http://nishantrana.wordpress.com/2009/06/30/javascript-on-click-of-finish-button-in-survey-sharepoint/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 10:11:57 +0000</pubDate>
		<dc:creator>Nishant Rana</dc:creator>
				<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://nishantrana.wordpress.com/?p=712</guid>
		<description><![CDATA[Hi,
We had created a survey and wanted some message to appear when user clicks on finish button.
Through one of my colleague i came to know about this function &#8212; PreSaveAction
function PreSaveAction()
{
alert(&#8220;Thanks for the participating in the survey!&#8221;);
return true;
}
Placing the above function in the newform.aspx using SharePoint designer  did the trick.
We could use the PreSaveAction function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=712&subd=nishantrana&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi,</p>
<p>We had created a survey and wanted some message to appear when user clicks on finish button.</p>
<p>Through one of my colleague i came to know about this function &#8212; PreSaveAction</p>
<p>function PreSaveAction()<br />
{<br />
alert(&#8220;Thanks for the participating in the survey!&#8221;);<br />
return true;<br />
}</p>
<p>Placing the above function in the newform.aspx using SharePoint designer  did the trick.</p>
<p>We could use the PreSaveAction function for custom validation as well !</p>
<p><a title="PreSaveFunction" href="http://edinkapic.blogspot.com/2007/10/add-javascript-date-validation-into.html" target="_blank">http://edinkapic.blogspot.com/2007/10/add-javascript-date-validation-into.html</a></p>
<p>Bye..</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nishantrana.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nishantrana.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nishantrana.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nishantrana.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nishantrana.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nishantrana.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nishantrana.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nishantrana.wordpress.com/712/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nishantrana.wordpress.com/712/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nishantrana.wordpress.com/712/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=712&subd=nishantrana&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nishantrana.wordpress.com/2009/06/30/javascript-on-click-of-finish-button-in-survey-sharepoint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/110b603cfbecdae6ba10459409a7f1cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nishu</media:title>
		</media:content>
	</item>
		<item>
		<title>Sort SPFolder in SharePoint</title>
		<link>http://nishantrana.wordpress.com/2009/05/13/sort-spfolder-in-sharepoint/</link>
		<comments>http://nishantrana.wordpress.com/2009/05/13/sort-spfolder-in-sharepoint/#comments</comments>
		<pubDate>Wed, 13 May 2009 10:45:45 +0000</pubDate>
		<dc:creator>Nishant Rana</dc:creator>
				<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://nishantrana.wordpress.com/2009/05/13/sort-spfolder-in-sharepoint/</guid>
		<description><![CDATA[We developed a web part showing the folders hierarchy using tree view control. However the folders were not getting displayed in the tree view node in the order they are visible inside the document library i.e. sorted on name.
Creating a tree view
http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?List=f0e16a1a-6fa9-4130-bcab-baeb97ccc4ff&#38;ID=115
So finally used the following code to sort the folders

List&#60;SPFolder&#62; folderList = new List&#60;SPFolder&#62;();
foreach [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=631&subd=nishantrana&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>We developed a web part showing the folders hierarchy using tree view control. However the folders were not getting displayed in the tree view node in the order they are visible inside the document library i.e. sorted on name.</p>
<p>Creating a tree view</p>
<p><a href="http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?List=f0e16a1a-6fa9-4130-bcab-baeb97ccc4ff&amp;ID=115">http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?List=f0e16a1a-6fa9-4130-bcab-baeb97ccc4ff&amp;ID=115</a></p>
<p>So finally used the following code to sort the folders</p>
<p></p>
<p>List&lt;SPFolder&gt; folderList = new List&lt;SPFolder&gt;();</p>
<p>foreach (SPFolder myFolder in folder.SubFolders){</p>
<p>folderList.Add(myFolder);</p>
<p>}</p>
<p>folderList.Sort(delegate(SPFolder p1, SPFolder p2) { return p1.Name.CompareTo(p2.Name); });</p>
<p>For more information on sorting</p>
<p><a href="http://www.developerfusion.com/code/5513/sorting-and-searching-using-c-lists/">http://www.developerfusion.com/code/5513/sorting-and-searching-using-c-lists/</a></p>
<p>Bye..</p>
<p></p>
<p></p>
<p></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nishantrana.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nishantrana.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nishantrana.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nishantrana.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nishantrana.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nishantrana.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nishantrana.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nishantrana.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nishantrana.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nishantrana.wordpress.com/631/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=631&subd=nishantrana&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nishantrana.wordpress.com/2009/05/13/sort-spfolder-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/110b603cfbecdae6ba10459409a7f1cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nishu</media:title>
		</media:content>
	</item>
		<item>
		<title>File not found error in NewDwp.aspx SharePoint</title>
		<link>http://nishantrana.wordpress.com/2009/05/05/file-not-found-error-in-newdwpasps-sharepoint/</link>
		<comments>http://nishantrana.wordpress.com/2009/05/05/file-not-found-error-in-newdwpasps-sharepoint/#comments</comments>
		<pubDate>Tue, 05 May 2009 07:38:44 +0000</pubDate>
		<dc:creator>Nishant Rana</dc:creator>
				<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://nishantrana.wordpress.com/2009/05/05/file-not-found-error-in-newdwpasps-sharepoint/</guid>
		<description><![CDATA[Hi,
I was getting this error while trying to all a new custom web part to the site.
Searching for the same found out the reason for that
It happens when you install smart part
http://www.codeplex.com/smartpart
But haven&#8217;t installed asp.net ajax 1.0 version !
http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&#38;displaylang=en
Follow it with an iis reset !!
Bye ..
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=622&subd=nishantrana&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi,</p>
<p>I was getting this error while trying to all a new custom web part to the site.</p>
<p>Searching for the same found out the reason for that</p>
<p>It happens when you install smart part</p>
<p><a title="SmartPart" href="http://www.codeplex.com/smartpart" target="_blank">http://www.codeplex.com/smartpart</a></p>
<p>But haven&#8217;t installed asp.net ajax 1.0 version !</p>
<p><a title="Ajax" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&amp;displaylang=en" target="_blank">http://www.microsoft.com/downloads/details.aspx?FamilyID=ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6&amp;displaylang=en</a></p>
<p>Follow it with an iis reset !!</p>
<p>Bye ..</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nishantrana.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nishantrana.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nishantrana.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nishantrana.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nishantrana.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nishantrana.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nishantrana.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nishantrana.wordpress.com/622/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nishantrana.wordpress.com/622/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nishantrana.wordpress.com/622/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=622&subd=nishantrana&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nishantrana.wordpress.com/2009/05/05/file-not-found-error-in-newdwpasps-sharepoint/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/110b603cfbecdae6ba10459409a7f1cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nishu</media:title>
		</media:content>
	</item>
		<item>
		<title>Understanding Application Pages and Site Pages</title>
		<link>http://nishantrana.wordpress.com/2009/04/28/understanding-application-pages-and-site-pages/</link>
		<comments>http://nishantrana.wordpress.com/2009/04/28/understanding-application-pages-and-site-pages/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 08:08:09 +0000</pubDate>
		<dc:creator>Nishant Rana</dc:creator>
				<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://nishantrana.wordpress.com/2009/04/28/understanding-application-pages-and-site-pages/</guid>
		<description><![CDATA[Pages that support user customization are known as site pages. E.g. the page that we could see inside our SharePoint designer like default.aspx (home page), NewForm, EditForm,DispForm.aspx etc. The site pages could easily be customized without making any changes to the local file system of the front-end web server and without any need of developer [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=617&subd=nishantrana&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">Pages that support user customization are known as site pages. E.g. the page that we could see inside our SharePoint designer like default.aspx (home page), NewForm, EditForm,DispForm.aspx etc. The site pages could easily be customized without making any changes to the local file system of the front-end web server and without any need of developer involved for that. This is possible by storing the customized version of the aspx and master page files inside the content database. The saving and retrievig of content from the database is provided using SPVirutalPathProvider class.<span>  </span></span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">More on SPVirtualPathProvider</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;"><a href="http://weblogs.asp.net/scottgu/archive/2005/11/27/431650.aspx">http://weblogs.asp.net/scottgu/archive/2005/11/27/431650.aspx</a></span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">Site pages could exist either in customized(unghosted) or uncustomized(ghosted) state.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">For e.g. when we create a new site using one of the default templates, the site as well as pages therin are in uncustomized state i.e. they are based on page templates that live on the file system of the front-end web server. Page template are used for provisioning (creating) page intances. As long as the page is not customized using SharePoint designer or through the Site Settings option the copy of the page is not stored in the content database and the pages are loaded from the file system of the web server. A single page template is compiled into an assembly and loaded into memory of IIS worker process one per web application. </span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">However when page is customized, SPVirtualPathProvider retrieves the customized version of the page from the content database and passes it to ASP.NET parser. Now these pages aren’t compiled into assembly. They are processed by ASP.NET parser in no-compile mode. </span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">No-comiple pages provide higher levels of scalability compared to compiled pages. Compiled pages offer following benefits </span></p>
<p style="margin-left:.5in;text-indent:-.25in;text-align:justify;"><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">         </span></span></span><span class="label"><strong><span style="font-size:10pt;font-family:Georgia;">Performance</span></strong></span><span class="label"><span style="font-size:10pt;font-family:Georgia;">   </span></span><span style="font-size:10pt;font-family:Georgia;">Compiled code is much faster than scripting languages such as ECMAScript or VBScript because it is a closer representation to machine code and does not require additional parsing. </span></p>
<p style="margin-left:.5in;text-indent:-.25in;text-align:justify;"><span style="font-size:10pt;font-family:Symbol;"><span>·<span style="font:7pt &quot;">         </span></span></span><span class="label"><strong><span style="font-size:10pt;font-family:Georgia;">Security</span></strong></span><span class="label"><span style="font-size:10pt;font-family:Georgia;">   </span></span><span style="font-size:10pt;font-family:Georgia;">Compiled code is more difficult to reverse engineer than non-compiled source code because it lacks the readability and abstraction of a high-level language. Additionally, there are obfuscation tools that make compiled code even more resistant to reverse engineering. </span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">However these compiled pages cannot be loaded into memory and unloaded in a manner similar to no-compile pages. .NET framework doesn’t support concept of unloading an assembly DLL from memory. By recycling the current Windows process or AppDomain it is possible to unload the dll, the issues is that it would unload all dll’s from memory, not any specific as desired. And moreover there is limit associated with number of assemblies that could be loaded in a .NET AppDomain.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">With no compiled pages there is no requirement of loading assemblies into the memory. Processing for compiled pages is done by loading control trees into memory. Once the processing is finished for a customized page, the page’s control tree is unloaded to free up memory resources. And also as the pages are not compiled, it provides faster response time for pages upon first access.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">No Compile Pages enables improved scaling for large sites with 1000s of pages, as windows has limit on number of DLLs loaded into an app and perf degrades as you hit this limit.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">Application pages are pages that don’t support customization. They cannot be customized using SharePoint designer. E.g. settings.aspx, create.aspx etc.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">These pages are deployed at \Layouts directory of 12 hive and are available to all the sites. They are compiled into a single dll and loaded into memory once per web application. They are used extensively for provisioning and administrating sites as well as elements inside the sites. Application pages links to application.master.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">So main differences between these two types of pages could be summarized as <span> </span></span></p>
<p style="margin-left:.5in;text-indent:-.25in;text-align:justify;"><span style="font-size:10pt;font-family:Georgia;"><span>1)<span style="font:7pt &quot;">      </span></span></span><span style="font-size:10pt;font-family:Georgia;">Site pages support customization whereas application pages don’t.</span></p>
<p style="margin-left:.5in;text-indent:-.25in;text-align:justify;"><span style="font-size:10pt;font-family:Georgia;"><span>2)<span style="font:7pt &quot;">      </span></span></span><span style="font-size:10pt;font-family:Georgia;">Site pages once customized run in no-compile mode whereas application pages are always compiled.</span></p>
<p style="margin-left:.5in;text-indent:-.25in;text-align:justify;"><span style="font-size:10pt;font-family:Georgia;"><span>3)<span style="font:7pt &quot;">      </span></span></span><span style="font-size:10pt;font-family:Georgia;">Now as site pages support customization it involves risk so under default security policy enforced by WSS we couldn’t write inline code in it<span>  </span>whereas it is allowed to write in-line code in case of application page.</span></p>
<p style="margin-left:.5in;text-indent:-.25in;text-align:justify;"><span style="font-size:10pt;font-family:Georgia;"><span>4)<span style="font:7pt &quot;">      </span></span></span><span style="font-size:10pt;font-family:Georgia;">Application page scale better than site page.</span><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p style="text-align:justify;"><span style="font-size:small;font-family:Times New Roman;">Bye..</span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nishantrana.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nishantrana.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nishantrana.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nishantrana.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nishantrana.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nishantrana.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nishantrana.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nishantrana.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nishantrana.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nishantrana.wordpress.com/617/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=617&subd=nishantrana&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nishantrana.wordpress.com/2009/04/28/understanding-application-pages-and-site-pages/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/110b603cfbecdae6ba10459409a7f1cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nishu</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint and ASP.NET Integration</title>
		<link>http://nishantrana.wordpress.com/2009/04/28/sharepoint-and-aspnet-integration/</link>
		<comments>http://nishantrana.wordpress.com/2009/04/28/sharepoint-and-aspnet-integration/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 06:32:08 +0000</pubDate>
		<dc:creator>Nishant Rana</dc:creator>
				<category><![CDATA[MOSS]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://nishantrana.wordpress.com/2009/04/28/sharepoint-and-aspnet-integration/</guid>
		<description><![CDATA[Whenever we create a new WSS web application in SharePoint, behind the scene a new IIS Web site gets created. Now to make it SharePoint specific, WSS does the following 
 

WSS makes few entries into the IIS Metabase. (IIS Metabase stores conifiguration information about it IIS Web Sites and Virtual Directories)
Creates virtual directories which maps [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=616&subd=nishantrana&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">Whenever we create a new WSS web application in SharePoint, behind the scene a new IIS Web site gets created. Now to make it SharePoint specific, WSS does the following </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<ul style="margin-top:0;" type="disc">
<li class="MsoNormal"><span style="font-size:10pt;font-family:Georgia;">WSS makes few entries into the IIS Metabase. (IIS Metabase stores conifiguration information about it IIS Web Sites and Virtual Directories)</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Georgia;">Creates virtual directories which maps to 12 hive (installation directory\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\)</span>
<ul style="margin-top:0;" type="circle">
<li class="MsoNormal"><em><span style="font-size:10pt;font-family:Georgia;">_controltemplates</span></em><span style="font-size:10pt;font-family:Georgia;"> – where user controls are kept.</span></li>
<li class="MsoNormal"><em><span style="font-size:10pt;font-family:Georgia;">_layouts</span></em><span style="font-size:10pt;font-family:Georgia;"> – has application pages in it.</span></li>
<li class="MsoNormal"><em><span style="font-size:10pt;font-family:Georgia;">_vti_bin</span></em><span style="font-size:10pt;font-family:Georgia;"> – dlls and web services repository</span></li>
<li class="MsoNormal"><em><span style="font-size:10pt;font-family:Georgia;">_wpresources</span></em><span style="font-size:10pt;font-family:Georgia;"> – resource file repository for Web Parts</span></li>
</ul>
</li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Georgia;">Adds WSS-specific web.config to the root directory of the IIS Web site.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Georgia;">Adds wildcard application map to route all incoming to<em> aspnet_isapi.dll</em>. (Right click your iis web site, select home directory, click on Configuration – there we could find the wildcard application map entry.</span></li>
</ul>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">Finally WSS extends the routing architecture of IIS and ASP.NET to properly route all incoming requests through WSS runtime.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">IIS maps an incoming request to a physical file within root directory of an IIS Web Site or virtual directory. (Virtual directory – an entity defining a child URL space nested within the URL space of its parent IIS Web Site. IIS provides the flexibility of defining the root directory for a virtual directory at any location)</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">IIS supports Internet Server Application Programming Interface (ISAPI) programming model, it allows us to configure an IIS Web Site or virtual directory so that incoming requests trigger the execution of the custom code on the Web Server.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">ISAPI programming models consists of ISAPI extension and ISAPI filters.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">ISAPI extension is a dll that serves as an endpoint for all the incoming requests.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">More on ISAPI extension </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"><a href="http://msdn.microsoft.com/en-us/library/ms525172.aspx">http://msdn.microsoft.com/en-us/library/ms525172.aspx</a></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">ISAPI filter-acts as an interceptor. It provides pre as well post processing for each and every incoming request. These extensions are however difficult to develop as they are written in C++.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">More on ISAPI filters</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"><a href="http://msdn.microsoft.com/en-us/library/ms524610.aspx">http://msdn.microsoft.com/en-us/library/ms524610.aspx</a></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">For better understanding of low level look at ASP.NET architecture </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"><a href="http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp">http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp</a></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">In short, ASP.NET framework is implemented as an ISAPI extension named aspnet_isapi.dll. Whenever IIS sees an incoming request targeting a file with extension like .aspx,.ascx,.asmx, based on the application map defined, it forwards the request to aspnet_isapi.dll, which effectively passes control over to ASP.NET framework.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">ASP.NET framework compiles an .aspx page to .dll. It parses the .aspx file to generate a C# file that inherits from Page class. Once the ASP.NET page parser builds the source c# file for an .aspx page, it than compile it into a dll. This occurs only the first time when the page is requested; afterwards the same dll is used for all the subsequent requests that target the same page.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">Now comes into picture HTTP request pipeline exposed by ASP.NET framework. It provides the developer with a degree of control comparable with ISAPI programming model. Http Request Pipeline contains HttpHandler, HttpApplication nad HttpModule components.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">Once a request comes into the AppDomain managed by the ASP.NET runtime, ASP.NET uses the HttpWorkerRequest class to store the request information. Following that, the runtime wraps the request&#8217;s information in a class named HttpContext. The HttpContext class includes all the information you&#8217;d ever want to know about a request, including references to the current request&#8217;s HttpRequest and HttpResponse objects. The runtime produces an instance of HttpApplication (if one is not already available) and then fires a number of application-wide events (such as BeginRequest and AuthenticateRequest). These events are also pumped through any HttpModules attached to the pipeline. Finally, ASP.NET figures out what kind of handler is required to handle the request, creates one, and asks the handler to process the request. After the handler deals with the request, ASP.NET fires a number of post-processing events (like EndRequest) through the HttpApplication object and the HttpModules.</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;">HttpApplication &#8211; During the lifetime of a Web application, the HttpApplication objects serve as places to hold application-wide data and handle application-side events.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">HttpModules &#8211; While the Application object is suitable for handling application-wide events and data on a small scale, sometimes application-wide tasks need a little heavier machinery. HttpModules serve that purpose.ASP.NET includes a number of predefined HttpModules. For example, session state, authentication, and authorization are handled via HttpModules.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">HttpHandlers -</span><span style="font-size:10pt;font-family:Georgia;">The last stop a request makes in the pipeline is an HttpHandler. Any class implementing the interface IHttpHandler qualifies as a handler. When a request finally reaches the end of the pipeline, ASP.NET consults the configuration file to see if the particular file extension is mapped to an HttpHandler. If it is, the ASP.NET loads the handler and calls the handler&#8217;s IHttpHandler.ProcessRequest method to execute the request.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">ASP.NET includes several HTTPHandlers already, including System.Web.UI.Page and System.Web.Services.WebService</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;"><a href="http://www.brainbell.com/tutorials/ASP/The_ASP.NET_Pipeline.html">http://www.brainbell.com/tutorials/ASP/The_ASP.NET_Pipeline.html</a></span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">WSS uses the above ASP.NET technique to extend the HTTP Request Pipeline.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">Configures each web application with custom HttpApplication object using SPHttpApplication class. This class is within Microsoft.SharePoint.dll. It creates a custom global.asax file at the root of Web Application that inherits from SPHttpApplication.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;background:yellow;font-family:Georgia;">&lt;%</span><span style="font-size:10pt;color:blue;font-family:Georgia;">@</span><span style="font-size:10pt;font-family:Georgia;"> <span style="color:#a31515;">Assembly</span> <span style="color:red;">Name</span><span style="color:blue;">=&#8221;Microsoft.SharePoint&#8221;</span><span style="background:yellow;">%&gt;&lt;%</span><span style="color:blue;">@</span> <span style="color:#a31515;">Application</span> <span style="color:red;">Language</span><span style="color:blue;">=&#8221;C#&#8221;</span> <span style="color:red;">Inherits</span><span style="color:blue;">=&#8221;Microsoft.SharePoint.ApplicationRuntime.SPHttpApplication&#8221;</span> <span style="background:yellow;">%&gt;</span></span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">It also makes use of custom HttpHandler and HttpModule as well. </span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">We could find their entries in web.config of the web applciation </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;color:blue;font-family:Georgia;"><span>  </span>&lt;</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">httpHandlers</span><span style="font-size:10pt;color:blue;font-family:Georgia;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;color:blue;font-family:Georgia;"><span>      </span>&lt;</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">remove</span><span style="font-size:10pt;color:blue;font-family:Georgia;"> </span><span style="font-size:10pt;color:red;font-family:Georgia;">verb</span><span style="font-size:10pt;color:blue;font-family:Georgia;">=</span><span style="font-size:10pt;font-family:Georgia;">&#8220;<span style="color:blue;">GET,HEAD,POST</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">path</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">*</span>&#8220;<span style="color:blue;"> /&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;color:blue;font-family:Georgia;"><span>      </span>&lt;</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">add</span><span style="font-size:10pt;color:blue;font-family:Georgia;"> </span><span style="font-size:10pt;color:red;font-family:Georgia;">verb</span><span style="font-size:10pt;color:blue;font-family:Georgia;">=</span><span style="font-size:10pt;font-family:Georgia;">&#8220;<span style="color:blue;">GET,HEAD,POST</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">path</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">*</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Microsoft.SharePoint.ApplicationRuntime.<strong>SPHttpHandler</strong>, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</span>&#8220;<span style="color:blue;"> /&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;color:blue;font-family:Georgia;"><span>   </span><span>   </span>&lt;</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">add</span><span style="font-size:10pt;color:blue;font-family:Georgia;"> </span><span style="font-size:10pt;color:red;font-family:Georgia;">verb</span><span style="font-size:10pt;color:blue;font-family:Georgia;">=</span><span style="font-size:10pt;font-family:Georgia;">&#8220;<span style="color:blue;">OPTIONS,PROPFIND,PUT,LOCK,UNLOCK,MOVE,COPY,GETLIB,PROPPATCH,MKCOL,DELETE,(GETSOURCE),(HEADSOURCE),(POSTSOURCE)</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">path</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">*</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Microsoft.SharePoint.ApplicationRuntime.<strong>SPHttpHandler</strong>, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</span>&#8220;<span style="color:blue;"> /&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;background:yellow;color:blue;font-family:Georgia;">// other handlers</span><span style="font-size:10pt;color:blue;font-family:Georgia;"></span></p>
<p style="text-align:justify;"><span style="font-size:10pt;color:blue;font-family:Georgia;"><span>    </span>&lt;/</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">httpHandlers</span><span style="font-size:10pt;color:blue;font-family:Georgia;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;color:blue;font-family:Georgia;">&lt;</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">httpModules</span><span style="font-size:10pt;color:blue;font-family:Georgia;">&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;color:blue;font-family:Georgia;"><span>      </span>&lt;</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">clear</span><span style="font-size:10pt;color:blue;font-family:Georgia;"> /&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;color:blue;font-family:Georgia;"><span>      </span>&lt;</span><span style="font-size:10pt;color:#a31515;font-family:Georgia;">add</span><span style="font-size:10pt;color:blue;font-family:Georgia;"> </span><span style="font-size:10pt;color:red;font-family:Georgia;">name</span><span style="font-size:10pt;color:blue;font-family:Georgia;">=</span><span style="font-size:10pt;font-family:Georgia;">&#8220;<span style="color:blue;">SPRequest</span>&#8220;<span style="color:blue;"> </span><span style="color:red;">type</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Microsoft.SharePoint.ApplicationRuntime.<strong>SPRequestModule</strong>, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</span>&#8220;<span style="color:blue;"> /&gt;</span></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;background:yellow;font-family:Georgia;">// other http modules</span><span style="font-size:10pt;font-family:Georgia;"></span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"><span>    </span>&lt;/<span style="color:#a31515;">httpModules</span>&gt;</span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p class="MsoNormal" style="text-align:justify;margin:0;"><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">And finally it makes use of SPVirtualPathProvider, which abstracts the details of where page files are stored away from the ASP.NET runtime, using which the pages are served from content database. Once the content are retrieved by Virtual path provider it is passed to asp.net runtime for parsing. SPRequestModule component contains code to register SPVirutalPathProvider class with ASP.NET framework. SPVirutalPathProvider class works toghether with SPPageParserFilter to supply processing instructions to ASP.NET page parser whether to compile the aspx page to dll or process it in no compile mode.</span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">More on virual path provider </span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;"><a href="http://weblogs.asp.net/scottgu/archive/2005/11/27/431650.aspx">http://weblogs.asp.net/scottgu/archive/2005/11/27/431650.aspx</a></span><span style="font-size:10pt;font-family:Georgia;"> </span></p>
<p style="text-align:justify;"><span style="font-size:10pt;font-family:Georgia;">Bye..</span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nishantrana.wordpress.com/616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nishantrana.wordpress.com/616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nishantrana.wordpress.com/616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nishantrana.wordpress.com/616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nishantrana.wordpress.com/616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nishantrana.wordpress.com/616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nishantrana.wordpress.com/616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nishantrana.wordpress.com/616/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nishantrana.wordpress.com/616/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nishantrana.wordpress.com/616/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nishantrana.wordpress.com&blog=1794554&post=616&subd=nishantrana&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://nishantrana.wordpress.com/2009/04/28/sharepoint-and-aspnet-integration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/110b603cfbecdae6ba10459409a7f1cb?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">nishu</media:title>
		</media:content>
	</item>
	</channel>
</rss>