“s4-notdlg” not doing what it should be doing

Today, I was playing around in SharePoint 2010 and I was setting up a FAQ where you show the questions using a CQWP and open the details in a SharePoint popup dialog. Works great but the problem was that I was trying out a custom masterpage and the dialog showed the complete masterpage with the header, left navigation and so on… not what you want. I switched to a OOTB masterpage and it worked. So it had to be something in my custom masterpage.

Then it hit me, you need to add the s4-notdlg class to the elements you don’t want to render in a popup. Offcourse! Stupid!

I added the class but damn… still no joy. I found a post from Ben Ramey where he explained the same behavior if you forgot the <SharePoint:CssLink runat=”server” Version=”4″ />. But this tag was included in my masterpage. So, this was not the reason.

I started comparing an OOTB masterpage with mine and starting changing small things here and there, testing along the way.
And I found the culprit… it was the runat=”server” attribute on the <html> tag which wasn’t in mine. After I added it, the tags which had the s4-notdlg class didn’t render in a dialog anymore.

Another thing I noticed was that some items didn’t show up directly in the CQWP. Even if I checked them in. Did some searching and I stumbled on an article of Michael Nemtsev where he explains this and gives a workaround. (Why Content Query Web Part (CQWP) doesn’t return all results)

Published by


Bart is a certified SharePoint consultant / architect at CTG Belgium NV with a broad professional experience in IT, a background in software development with a specialisation in Microsoft products and technologies and a solid knowledge and experience in Microsoft SharePoint Products and Technologies. He started as a COBOL developer on a mainframe environment and grew into software development for Windows platforms. Participated in projects varying from migrations of existing applications to development of Web applications and Windows applications. Became fascinated by the SharePoint 2007 platform and strongly believed in the added business value of this platform. Is since then fully committed to SharePoint and focuses on SharePoint implementations, migrations, integrations, design and coaching. Stays on top of new developments within the SharePoint technology stack and related technologies.

One thought on ““s4-notdlg” not doing what it should be doing”

Comments are closed.