Table of contents
Collapse the table of content
Expand the table of content

BrandingExtensions.SetMasterPageByUrl Method

SharePoint Dev Documents|Last Updated: 5/20/2017
1 Contributor

Set master page by using given URL as parameter. Suitable for example in cases where you want sub sites to reference root site master page gallery. This is typical with publishing sites.

Assembly: OfficeDevPnP.Core.dll


public static void SetMasterPageByUrl(this Web web, String masterPageServerRelativeUrl, Boolean resetSubsitesToInherit = False, Boolean updateRootOnly = False)



  Type: Microsoft.SharePoint.Client.Web
  Context web


  Type: System.String
  URL to the master page.

(optional) resetSubsitesToInherit

  Type: System.Boolean
  false (default) to apply to currently inheriting subsites only; true to force all subsites to inherit

(optional) updateRootOnly

  Type: System.Boolean
  false (default) to apply to subsites; true to only apply to specified site

Return Value

Type: void

See also

© 2018 Microsoft