This SharePoint 2010 tutorial explains the difference between site pages and application pages in SharePoint 2013/2010. Learn what are application pages and site pages in SharePoint 2010/2013/Online.
Application Pages in SharePoint 2013/2010
Application pages in SharePoint 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 in SharePoint 2010. An Application page cannot be customized and modified by an end-user, instead, a developer is required. These are the normal .aspx pages deployed within SharePoint.
The most common of them is the admin pages found in the _layouts folder. These are deployed either at the farm level or at an application level. If they are deployed within the _layouts folder or global SharePoint Virtual Directory, then they can be used by any SharePoint application (available at the farm level), otherwise, they can be deployed at the 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. If you deploy your custom ASPX pages within the _layouts folder or within the 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. Since application pages are compiled once, they are much faster Normally application pages are not web part pages, hence they can only contain server controls or user controls and cannot be personalized by users.
The easiest way to deploy your existing ASP.Net website within SharePoint is to deploy its pages as Application Pages within SharePoint. In this way, you can convert any ASP.Net web solution as a 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. Application pages can be globalized using Resource files only.
Site Pages in SharePoint 2013/2010
Site Pages is a concept where a complete or partial page is stored within the content database and then the actual page is parsed at runtime and delivered to end-users. Site pages can be edited by using the SharePoint Designer tool in SharePoint 2010/2013.
SharePoint 2010 Site pages are used within Sandboxed solutions.
A site page can be customized and modified by an end user. 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 the 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 the 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 the database and then retrieved at runtime, 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 the database, they can utilize master pages stored within the SharePoint master pages library and merged with them at runtime for rendering. They are slower as compared to Application pages as they are parsed every time 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.
The 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 the following configuration within web.config: To add code behind to SharePoint master pages or page layouts.
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.
You may like follow SharePoint site pages tutorials:
- Site pages library missing in SharePoint Online/2013/2016/2019
- Create a site page using SharePoint object model
- Create and Deploy SharePoint 2013 site pages or content pages using Visual Studio 2013
- SharePoint Online: Cannot create a site page. please have your administrator enable the required feature on this site
- Creating a site page for enabling Modern UI experience in Office 365 SharePoint Online
- [Solved] Site assets library missing in SharePoint Online/2019/2016/2013
I hope this SharePoint tutorial explains the difference between site pages and application pages in SharePoint 2013/2010/Online
Download SharePoint Online Tutorial PDF FREE!
Get update on Webinars, video tutorials, training courses etc.