SharePoint Application Pages Vs Site Pages
Application Pages:
- Application pages are stored in the server's file system.
- SharePoint Designer tool cannot be used with application pages.
- Application pages cannot be used within Sandboxed solutions.
- An Application page cannot be customized and modified by end user, instead a developer is required.
- These are the normal .aspx pages deployed within SharePoint. Most common of them are the admin pages found in _layouts folder.
- These are deployed either at the farm level or at application level. If they are deployed within _layouts folder or global SharePoint Virtual Directory, then they can be used by any SharePoint application (available at farm level), otherwise they can be deployed at application level only by creating a virtual directory.
- These are typical ASP.Net aspx pages and can utilize all of the functionalities available within ASP.Net including code-behind, code-beside, inline coding etc.
- These are compiled by .Net runtime like normal pages.
- Since application pages are compiled once, they are much faster.
- If you deploy your custom ASPX pages within _layouts folder or within SharePoint application using a virtual directory, you will not be able to use SharePoint master pages and have to deploy your master page within the virtual directory or _layouts folder.
- Application Pages cannot use contents as this concept is associated with SharePoint Page Layouts not with ASP.Net.
- Normally application pages are not web part pages, hence can only contain server controls or user controls and cannot be customized by the end users.
- Easiest way to deploy your existing ASP.Net web site within SharePoint is to deploy its pages as Application Pages within SharePoint. In this way you can convert any ASP.Net web solution as SharePoint application with minimal efforts.
- SharePoint specific features like Information Management Policies, Workflows, auditing, security roles can only be defined against site pages not against application pages.
- Site Pages is a concept where complete or partial page is stored within content database and then actual page is parsed i.e. it takes content from content database and layout from the file system folder at runtime and delivered to end-users.
- Site pages can be edited by using SharePoint Designer tool.
- Site pages are used within Sandboxed solutions.
- A site page can be customized and modified by end user.
- They are slower as compared to Application pages as they are parsed every time they are accessed.
- Pages stored in Pages libraries or document libraries or at root level within SharePoint (Wiki pages) are Site Pages.
- Another advantage is they are at user-level not at web-application or farm level and can be customized per site level.
- In Site Pages, users cannot add the code. However Best way of adding any inline 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>