0

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??)

1

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";
    oFolder.Update();
    oWebsite.Dispose();
}

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.