How To Add Custom aspx Page in Sharepoint 2010

Add Custom aspx Page in Sharepoint 2010

Adding aspx Page in SharePoint
2010 is much easier than what it was in SharePoint 2007.

You will start
with Creating a Empty Project in VS 2010 and then will add a aspx page as a new
Item. VS 2010, as you may know will automatically create all the required
solution package files (along with feature files) for easy deployment of our
aspx page.

You would however, would need to modify the aspx page to add
Contentplaceholders so that the Page can be displayed in sharePoint context( I
mean with SharePoint master Page and left nav and ribbion and stuff.. not sure
if ribbon will work though) and also will have to create a folder structure i.e
Templates\Layouts\ for the correct deployment of our aspx page.

to begin with

1. Open VS 2010 and create a empy Project

2. Create
a folder structure in your project as Template\Layouts\MyCustomFolder

Now, Right Click on the Project and add a New Item

Now, to add a new aspx page in our MyCustomFolder click on General tab on the
left navigation of the window and choose Text File. Rename the Text file to
MyCustomPage.aspx. Alternatively, you can click on Web and that will add aspx

Since, we have created a aspx page from a text file you will have to add all the
markup tags for the Page. The tags should also include sharePoint assemblies and
some content Place holders are need so that the page is displayed in sharePoint
context i.e like other content pages with master page and left amd top
naviagtion. See the Post : Deploy
Custom aspx page in SharePoint

:If you are using some code behind with your aspx page, then change the Inherit
tag in the aspx page to inherit
from the assembly of the project.

For e.g. change the tag

Inherits="NameSpace.Class, NameSpace, Version=,
Culture=neutral, PublicKeyToken=2ef8d0c4bab8980b" Debug="true".

You dont
need to deploy .cs file with the Project. The code is accessed via its .dll

6. Now you are all set to deploy the Project so build the project and
Also, make sure the manifest file do contain an entry for your custom
page in its tag.

Test your new custom page in sharePoint by
using the below url
http://SP server/_layouts/Custompage.aspx.

Posts :
and Deploying Custom aspx Page in SharePoint 2007