Set Home page of sharepoint sites

Hi,

According to the client's requirement, every site must be set as a custom home page other then "Pages/Default.aspx". I have added a site definition using CKSDev tool and add this page using Onet.xml.

Next step is to create a feature at web level which should contains following code:

SPFolder rootFolder = properties.Web.RootFolder;
rootFolder.WelcomePage = "default.aspx";
rootFolder.Update();


This code will also work for any site template.

Comments

Popular posts from this blog

Hide Ribbon on SharePoint 2013 using CSS

Get Comment Count in SharePoint

Configure external site as content sources in sharepoint search