I did some looking around and I was planning on creating the following js function to open a custom page in a dialog:

     //Handle the DialogCallback callback 
          function DialogCallback(dialogResult, returnValue){ 

      //Open the Dialog 
      function OpenDialog(url){ 
       var options = { 
            url:url + "?IsDlg=1", 
         width: 700, 
         height: 700, 
         dialogReturnValueCallback: DialogCallback 
     return false;

Is this the right way to do this? I thought I had read somewhere that I could just add the IsDlg query string parameter to make this happen, but this does not appear to work.


That is the only way I have seen. From what I understand , the "IsDlg=1" querystring parameter strips the ribbon and navigtion controls off the page, but doesn't actually create the dialogue box.


With the Custom Dialog you have two things; the caller which includes the javascript code you included and then the page that is loaded in the dialog. The code you provided would load the given page in a dialog. Typically that is stored separately from the calling page.

As @andrew.petersen15 noted, the IsDlg=1 is just used to change the way the page is rendered and strips off many of the page objects such as the ribbon and nav since they do not apply within a dialog.


I guess we haven't established whether or not you are actually able to see a dialog window open, or whether it looks like a full page when it opens, and not a dialog window.

If it's the latter, when you are calling your OpenDialog function, does the url you are passing already contain a query string?

For example


If so, I'm not sure the "?IsDlg=1" that you are appending will work. If the url you are passing to OpenDialog already contains a querystring, you would need to append "&IsDlg=1" instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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