Partager via


Web Part Page Execution

The new Web Parts infrastructure builds on ASP.NET by providing a Microsoft .NET object model that contains classes that derive from and extend ASP.NET classes. Additional classes and database objects handle storage (in Microsoft SQL Server™ or MSDE) and site administration.

In a Microsoft® Windows® Sharepoint™ Services environment, each page request that hits Microsoft Internet Information Services (IIS) is handed over to the ASP.NET HTTP pipeline. The HTTP pipeline is a chain of managed objects that sequentially process the request and make the transition from a URL to plain HTML text happen.

At installation time, Windows SharePoint Services registers itself as the IHTTPHandler for all .aspx requests. This association between types of resources and types of handlers is stored in the configuration file of the application. More exactly, the default set of mappings is defined in the <httpHandlers> section of the web.config file. The line below illustrates the code that defines the HTTP handler for .aspx resources once Windows SharePoint Services is installed.

<add verb="*" path="*.aspx" type="Microsoft.SharePoint.ApplicationRuntime.SharePointHandlerFactory"/>

The Windows SharePoint Services IHTTPHandler requires that all page requests are Web Part Pages, that is, that they derive from the WebPartPage class. If the @Page directive is missing, it defaults to a Web Part Page and the request is passed to the Web Part infrastructure for rendering, as are any requests whose @Page directives identify Web Part Pages. If an @Page directive identifes a page that is not a Web Part Page, an error is returned.

Once the request is passed to the Web Part infrastructure, Windows SharePoint Services determines whether the page is stored in the file system or the SharePoint database. For pages that are stored in the file system (for example, any pages in the _layouts directory, or any pages that were created from the built-in Web Part Page templates and not modified), the request is handed off to the ASP.NET infrastructure for rendering; otherwise, the page is rendered by the Web Part infrastructure. In either case, once the page is rendered, a Web Part Page is returned to the requestor.

For information about rendering Web Parts, see Web Part Execution. For more information about working with Web Parts, see Web Part Infrastructure Concepts.