I have an existing Visual Studio solution containing web parts etc.
I want to add a set of site pages to the solution, that will be deployed to the 'SitePages' folder of a site collection, when the solution is deployed.
How would I do that?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityThis link helped me with this back when I tried this with SharePoint 2013 (similar to how it's done in SP2010): http://blogs.msdn.com/b/kaevans/archive/2010/06/28/creating-a-sharepoint-site-page-with-code-behind-using-visual-studio-2010.aspx
Steps:
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Module Name="SitePagesModule" Url="SitePages"> <File Path="SitePagesModule\SitePages\page1.aspx" Url="SitePagesModule/page1.aspx" Type="GhostableInLibrary" /> <File Path="SitePagesModule\SitePages\page2.aspx" Url="SitePagesModule/page2.aspx" Type="GhostableInLibrary" /> </Module> </Elements>