Export (0) Print
Expand All

Master Pages on Application Pages

SharePoint 2010

Last modified: October 02, 2009

Applies to: SharePoint Foundation 2010

In this article
Using the DynamicMasterPageFile Attribute
Safeguarded Application Pages
Using Dynamic Master Pages on Custom Application Pages

In Microsoft SharePoint Foundation, application pages can now inherit a customized site master page through the DynamicMasterPageFile attribute.

The DynamicMasterPageFile attribute replaces the MasterPageFile attribute on application pages in SharePoint Foundation. By using the DynamicMasterPageFile attribute, the application page references the site master page rather than the default application master page. If needed, site administrators can disable this automatic referencing of the site master page through Central Administration or by using the MasterPageReferenceEnabled property of the SPWebApplication object.

There are some application pages that have safeguards to prevent errors that can occur due to "broken" site master pages. These safeguards are detailed below.

These are the application pages that have safeguards against a broken master page. If these pages encounter an error when loading the dynamic master page, a safe master page in the _layouts folder is loaded instead.

  • AccessDenied.aspx

  • MngSiteAdmin.aspx

  • People.aspx

  • RecycleBin.aspx

  • ReGhost.aspx

  • ReqAcc.aspx

  • Settings.aspx

  • UserDisp.aspx

  • ViewLsts.aspx

If you are creating a custom application page, your page must inherit from the LayoutsPageBase base class and must use one of the dynamic tokens listed below.

Dynamic tokens:

  • ~masterurl/default.master – The application page references the master page file that is stored in the MasterUrl property.

  • ~masterurl/custom.master – The application page references the master page file that is stored in the CustomMasterUrl property.

Important note Important

Static tokens cannot be used in the DynamicMasterPageFile attribute.

Show:
© 2014 Microsoft