DCSIMG
How to make your page dialog aware - itaysk

How to make your page dialog aware

Posted Thursday, February 11, 2010 11:51 PM by Itay Shakury

Lets say that I have a wiki page called “itaysk.aspx”. and lets say that I use this page inside a SharePoint dialog.

When I created the page, it looked like this: (click on the pics to enlarge)

dlg_1

And the dialog looks like this:

dlg_2

See the difference? When the page is presented inside a dialog, we see a lighter version of the page. And that’s actually very good, because in a dialog, we want the content of the page, and not full design of the master page.

So how is this happening?

When called from a dialog, a special query string parameter is added to the address. It is called IsDlg and makes the page know it is inside a dialog.

dlg_4 

What does IsDlg=1 actually does?

Well, lets take a look at something that is present in the page, and disappeared in the dialog:

dlg_3

As you can see, the quick launch menu is assigned a css class called: “s4-notdlg”. This is the secret behind this process. Every element in the page that has this class, is not to be displayed inside a dialog, and that applies to your custom content as well.

תגים:,

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: