I'm developing a new Application Page using Visual Studio 2010 with code behind it. When I deploy the solution, the page gets deployed to the _layouts folder but I would like to have the page for users to view as if it was a normal page in the Pages-document library.

Is this possible?


1 Answer 1


Application pages are shared across all sites on the server, whereas a site page is specific to one site.

By default, most of the pages that appear when you create a SharePoint site are site pages. A site page can be added to a SharePoint page library. Users can customize a site page by using tools such as SharePoint Designer. A site page can also host features such as dynamic Web Parts, and Web Part Zones.

Application pages cannot do these things. However an application page is the best type of page to create if you want the page to contain custom code. Although you can add custom code to a site page, the code stops running when the user customizes the page by using tools such as SharePoint Designer. (Source)

You can create a Web Part Page and deploy it to the library

  • Thanks for the reply! I want to add custom code so I'm definitely going with creating an application page. Now the problem is that the page resides in the _layouts folder and I would like to have it in a document library with other pages. Is this possible at all? Cheers!
    – Juhani
    Commented Nov 9, 2011 at 23:07
  • You could move the custom code to some controls, create a new page that is inherited from WebPartPage, add these controls to this page and deploy this page to the Library. As you can read in post that I provided, the Application page cannot be deployed to the Library.
    – Alexander
    Commented Nov 10, 2011 at 7:28
  • Thanks Alexander, you got me on the right track! What I did was that I moved all of my code (except for SharePoint 2010 content placeholders like AdditionalPageHead etc) from the Application Page to a new Visual Web Part that I created in Visual Studio 2010. After deploying the new web part, I created a new blank page in the Pages-library and I just Inserted the new custom web part to the page and voila! Works perfectly and now the application runs inside a page that resides in a document library - exactly what I wanted! Thanks Alexander!!
    – Juhani
    Commented Nov 20, 2011 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.