SPSecurity.RunWithElevatedPrivileges( delegate () { using (SPSite site = properties.Feature.Parent as SPSite) { using (SPWeb web = site.OpenWeb()) { //Logging feature activation status in list web.AllowUnsafeUpdates = true ; //Changing the master page web.CustomMasterUrl = "/commerce/Custom/_catalogs/masterpage/Custom.master" ; web.MasterUrl = "/commerce/Custom/_catalogs/masterpage/Custom.master" ; //Setting the Navigation propertiers for web web.AllProperties[ "__IncludeSubSitesInNavigation" ] = "False" ; web.AllProperties[ "__IncludePagesInNavigation" ] = "True" ; web.Update(); } } } |
The greatest test of courage on earth is to bear the defeat without losing heart..
Monday, July 23, 2012
sharepoint programmatically change master page
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment