2

After upgrading a 2010 site to 2013 in 2010 UI mode, I'm unable to apply a custom master page to application (_layouts) pages. The custom master page has been configured as the Site and System master page and shows up correctly throughout the site whether logged in or not. However, I have a custom login page, e.g.

/_layouts/MyPages/Login.aspx

And the master page is not being applied there as it was prior to upgrading. I have tried both of these variants in the Page declaration:

DynamicMasterPageFile="~masterurl/default.master"
DynamicMasterPageFile="~masterurl/custom.master"

It reverts to /_layouts/simplev4.master either way.

Update: switching from having the page inherit from IdentityModelSignInPageBase to instead use UnsecuredLayoutsPageBase solved this.

1

The attribute "DynamicMasterPageFile" will attempt to read from the Master Pages configured on the Web.

I would start by checking out which Master Pages are set under Site Settings (or using PowerShell, checking the value of the SPWeb object for the Master Page's Urls).

Another alternative would be to hardcode the Master page you want to use by replacing the "DynamicMasterPageFile" for "MasterPageFile" and pointing to the _catalogs, as explained here:

http://mmman.itgroove.net/2012/08/24/using-a-page-specific-master-page-in-sharepoint-2010/

Additionally, I would check the "MasterPageReferenceEnabled" status, and that your Application Page inherits from "LayoutsPageBase" as explained in this link:

https://msdn.microsoft.com/en-us/library/office/ee537530(v=office.14).aspx

  • Application pages don't belong to any particular web, do they? Regardless, I did check the master page paths on the root web and they are correctly pointing to my custom master page. I tried the suggestion in your link and got this error: The file '/_layouts/MyPages/~site/_catalogs/masterpage/mymasterpage.master' does not exist. – Lana_M Feb 4 '15 at 2:12
  • Application pages do not belong to any particular web. – Amadeo Gallardo Feb 4 '15 at 2:22
  • Your URL doesn't look correct. Try "~sitecollection/_catalogs/masterpage/mymasterpage.master" – Amadeo Gallardo Feb 4 '15 at 2:32
  • I have verified MasterPageReferenceEnabled is true on the web application. I tried your master page URL (DynamicMasterPageFile="~sitecollection/_catalogs/masterpage/mymasterpage.master") and received this error: Content controls are allowed only in content page that references a master page. – Lana_M Feb 4 '15 at 2:46
  • Try MasterPageFile="~sitecollection/_catalogs/masterpage/mymasterpage.master‌​". Also, I don't know the code you have on your ApplicationPage, so the error showing there might be "valid" depending on whether you have the correct syntax in the Page's content (i.e. everything should be inside ContentPlaceHolder) – Amadeo Gallardo Feb 4 '15 at 2:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.