Change master page for Publlishing site .
SPSite curSite = new SPSite(http://MySERVER:1000/);
SPWeb objweb = curSite.OpenWeb(strWeb);
//Besure to check the path of the master page.
Uri masterUri = new Uri("http://MySERVER:1000/" + /_catalogs/masterpage/My_MasterPage_Blank_right_1.0.master");
objweb.CustomMasterUrl = masterUri.AbsolutePath;
objweb.AllowUnsafeUpdates = true;
objweb.Update();
objweb.AllowUnsafeUpdates = false;
No comments:
Post a Comment