3

I have recently created a custom master page for a SharePoint 2016 environment. My issue is that it is now showing on Pages like Add a Page, which is not ideal. Is there anyway i can change this so the dialog boxes do not show the custom master page?

3 Answers 3

2

s4-notdlg ms-dialogHidden these are the two class name which will solve your problem.

Also read the explanation here. Method for adding a Watermark Logo/Text to bottom of each Sharepoint page

1

Did you set master page programatically? If so, then there are two properties on SPWeb object:

  1. CustomMasterUrl
  2. MasterUrl

What you should set, is CustomMasterUrl (point to your new custom master page) and not MasterUrl.

Please find more info here

1

1) Set Seattle to default master page. 2) problematically include your custom master page where you should only use the custom master page.

Include the below code in page(.aspx) to use custom master page.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MyPage.aspx.cs" Inherits="SPBranding.Pages.MyPage" MasterPageFile="Custom.master" %>

If you do this way,default master page will show in 'add a page'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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