Page layouts included in a SharePoint solution require additional data to be added to their library properties to associate them with the page layout content type. In this recipe, we will include a copy of the BlankWebPartPage.aspx
page layout that we have renamed Tacoma_BlankWebPartPage.aspx
with the appropriate properties. You can download a copy of BlankWebPartPage.aspx
from the web interface or with SharePoint Designer.
Follow these steps to include a page layout in the solution:
From the Solution Explorer pane in Visual Studio, right-click on the project name.
Click on Add and then select New Item.
Navigate to Visual C# Items | Office/SharePoint and select Module.
Give a name to the Module (for example,
PageLayouts
).Click on Add.
Delete the
Sample.txt
file in thePageLayouts
module.Right-click on the
PageLayouts...