Thursday, July 21, 2011

SharePoint Virtual FileSystem

Having worked with ASP.NET Web applications, I was quite familiar with the ASP.NET request pipeline architecture. But after stepping into SharePoint development I came to notice that, in SharePoint the aspx page names displayed in the URL weren't physically present in the SharePoint Root ("%Program Files%\Common Files\Microsoft Shared\Web Server Extensions\14") directory. I tried searching the entire disk for the filename, but nothing showed up in the search results. Seeing this, I got curious on how this works, because this is the first time I am seeing an ASP.NET page served from nowhere, which I felt kind of mysterious.

After a brief search my mysterious situation went up in flames, because those asp.net(.aspx) pages which I was curiously searching for were actually stored in the SharePoint Content database and not on the filesystem. For me this was something new which was previously unheard of in ASP.NET development.

So by now my curiosity got to new heights like, how come an aspx page be served from a database, how does this thing work? This time the search results took me to msdn page, which reveals about a new class called VirtualPathProvider which was introduced with ASP.NET 2.0. The class provides the Virtual FileSystem functionality for asp.net web applications, I believe this class was developed primarily for meeting the SharePoint team requirement of abstracting aspx pages to datasource like SQL Server. If you wish to know more about VirtualPathProvider visit this link.


No comments: