Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a master detail kind of scenario. The detail (edit form) will be open in a Modal Dialog according to the setting below

 function OpenDialog(pageUrl, title) {

        var fullUrl = relativeUrl + pageUrl;

        var options = { showMaximized: true, url: fullUrl, title: title, dialogReturnValueCallback: DialogCallback };
        SP.UI.ModalDialog.showModalDialog(options);
    }

The problem is when the user click the update button in the modal dialog, after postback the modal dialog window size will shrink. It's like the showMaximized value is not set. How do I make sure that the Modal Dialog window size will remain the same after postback.

share|improve this question
    
none of these solutions worked for me. Could you please tell me if you found another way to keep the modal dialog size after postback. Thanks. –  user14991 Feb 19 '13 at 9:22

3 Answers 3

up vote 2 down vote accepted

Did you tried using following in your code ?

autoSize = false;
share|improve this answer

Hope, this will help.

function maximizeWindow()
{
    var currentDialog = SP.UI.ModalDialog.get_childDialog();

    if(currentDialog != null)
    {
      // if modal dialog is not maximized then set autosize, else remain maximized
      if(!currentDialog.$S_0)
      {
         currentDialog.autoSize();
      }
    }
}
share|improve this answer

if yaron's solution doesnt work out for you then have you tried EnableViewState?

http://msdn.microsoft.com/en-us/library/system.web.ui.control.enableviewstate.aspx

hope it helps :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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