When you are working with custom master pages with a customized left navigation (done with SP designer) you would have noticed that no matter how many times you set it as “Custom Master Page” and “Default Master Page” in designer the list forms in the site will open with its own left navigation. This is because the list forms will make use of the application master page which will be residing in the Layouts folder and not the default or custom master pages.
In one of my recent projects I had a mail notification feature for a list which will send a mail when a new item is added. The mail will be sent with a link to the item. So I build the URL as http://app/sites/site2/Lists/Invoices/Dispform.aspx?ID=5 which points to the item with the ID as 5 in the list Invoices.
But opening the link as such will show the list item with the old left navigation which we don’t want. So when I checked out the URL opened by SharePoint when “View item” is clicked in the ribbon I found that it opens with a query parameter IsDlg in the URL which mentions whether the item is opened in a dialog. But unfortunately when I tried the same parameter as IsDlg=1 in the link the item opened fine with the left navigation hidden but the scrollbars disabled. Arrgh. Now the SP madness begins. But before I plucked all my hair out I luckily found this brilliant answer by XueQi which mentions that we can either use IsDlg=0 or IsDlg=2 for the scrollbars to work fine.
And the expedition continues.