SharePoint Application Pages Vs Site Pages
Application Pages:
Site Pages
- Site Pages is a concept where complete or partial page is stored within content database and then actual page is parsed at runtime and delivered to end-users.
- Pages stored in Pages libraries or document libraries or at root level within SharePoint (Wiki pages) are Site Pages
- You must be thinking why we should use such pages? There are many reasons for this. One of the biggest catch of the SharePoint is the page layouts, where you can modify page once for a specific content type and then you can create multiple pages using the same page layout with different contents. In this case, contents are stored within database for better manageability of data with all the advantages of a data driven system like searching, indexing, compression, etc and page layouts are stored on file system and final page is created by merging both of them and then the outcome is pared by SharePoint not compiled.
- Site Pages can contain web parts as well as contents placeholders, and all of them are stored per page-instance level within database and then retrieved at run time, parsed and rendered.
- Another advantage is they are at user-level not at web-application or farm level and can be customized per site level.
- Since their definition is retrieved from database, they can utilize master pages stored within SharePoint masterpages library and merged with them at run time for rendering.
- They are slower as compared to Application pages as they are parsed everytime they are accessed.
- SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages not against application pages.
- Since they are rendered not compiled hence it is not easy to add any inline code, code behind or code beside. Best way of adding code to these pages is through web-parts, server controls in master pages, user controls stored in “Control Templates” folder or through smart parts. If you want to add any inline code to master page, first you need to add following configuration within web.config:<PageParserPaths>
<PageParserPath VirtualPath=”/_catalogs/masterpage/*” CompilationMode=”Always” AllowServerSideScript=”true” IncludeSubFolders=”true” />
</PageParserPaths> - To add code behind to SharePoint master pages or page layouts, refer to this MSDN article
- Since Site pages are content pages, hence all SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages.
- Variations can only be applied against Site pages for creating multilingual sites.
- “SPVirtualPathProvider” is the virtual path provider responsible for handling all site pages requests. It handles both ghosted and unghosted pages requests as shown below:
No comments:
Post a Comment