Home
Manage Your Code
Snippet: Sharepoint: Changing a MOSS Publishing Welcome Page Programatically (C#)
Title: Sharepoint: Changing a MOSS Publishing Welcome Page Programatically Language: C#
Description: Changing a MOSS Publishing Welcome Page Programatically Views: 1884
Author: Jukka Kotamäki Date Added: 11/12/2008
Copy Code  
1static public void UpdateWelcomePage(SPWeb web, string p)
2
3        {
4
5            if (PublishingWeb.IsPublishingWeb(web))
6
7            {
8
9                PublishingWeb pw = PublishingWeb.GetPublishingWeb(web);
10
11                PublishingSite site = new PublishingSite(web.Site);
12
13 
14
15                //Set the default page 
16
17                SPFile welcomefile = web.GetFile(p);
18
19                pw.DefaultPage = welcomefile;
20
21                pw.Update();
22
23            }
24
25        } 
26
27