Curia Damiano blog

Insert my slogan here...

SharePoint: how change the default page of a SPWeb

In SharePoint, you can change the default page of a site in two ways:

  • if the site is a PublishingWeb, cast you SPWeb to this type and set its DefaultPage property;
  • else, change the WelcomePage of its RootFolder:

SPFolder rootFolder = spWeb.RootFolder;
rootFolder.WelcomePage = "SitePages/MyHome.aspx";
rootFolder.Update();

In the documentation pages PublishingWeb.DefaultPage Property and SPFolder.WelcomePage Property there are both documentation and samples.

Comments (3) -

  • Jamie

    11/9/2011 6:20:10 AM | Reply

    I love this blog about SharePoint 2007.

  • how to become a fashion designer

    3/16/2012 7:15:29 PM | Reply

    I'm more than happy to find this website. I wanted to thank you for ones time just for this wonderful read!! I definitely liked every part of it and i also have you bookmarked to check out new stuff on your site.

  • Luisa - Diferencias entre tablet y ebook

    11/6/2014 3:46:20 PM | Reply

    Hi, it´s a great idea. I like very much your site. Byeee! xD

Loading