I have a Powershell script that creates a web app and a (root) site collection (Sharepoint 2010).

In VS2012 I want to deploy an application page that will be a introduction/startup page.

How can be done (as best practice) ?

(should I create an aspx page and create a module??)


You can create a module which which will deploy the page to a library. A site collection feature will then change the welcome page to the newly added page. See following code

using (SPSite oSiteCollection = new SPSite("http://MyServer/sites/MyWikiSite"))
    SPWeb oWebsite = oSiteCollection.OpenWeb();
    SPFolder oFolder = oWebsite.RootFolder; 
    oFolder.WelcomePage = "My Wiki Library/MyWelcome.aspx";
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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