INTRODUCTION
So my client is running SharePoint which unfortunately the main master page has been modified using SharePoint Designer; therefore it causes the master page to be “un-ghosted”. Any updates made to the original master page located in the source control (TFS) no longer affects the stored master page due to this disconnection.
Therefore, I had to copy/paste the customisation from the modified master page in the Master Page Catalog back to the one in source control. Then I removed all SharePoint Designer references (often denoted by the double underlines “__”). You will easily spot them.
After that I re-ghost the master page and it now starts using the source control version again.
It’s all good until I realise that the IsDlg parameter no longer works properly. The IsDlg parameter is injected when you open a list item or anything that involves modal window. The idea is, when IsDlg is set to 1 ie. IsDlg=1, the ribbon and left-navigation would be hidden. Pretty much, any HTML elements denoted by <div class=”s4-notdlg”> will be hidden.
RESOLUTION
The problem is, when you copy/paste the master page that has been modified by SharePoint Designer, the <html> element does not contain runat=”server”. This is required for IsDlg to work properly.
Therefore, all you need to do is to ensure that at the beginning of your master page, the runat=”server” attribute is set on your <html> tag such as:
<html runat="server">
...
</html>
Hope this helps,
Tommy