Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

Cheers!

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

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

share|improve this answer
    
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! –  Mr. J Nov 9 '11 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 Nov 10 '11 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!! –  Mr. J Nov 20 '11 at 2:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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