Refresh the Parent Browser window from SharePoint 2010 Modal Dialog

If you want to refresh the parent browser window from the SharePoint Dialog box ,please use the below code

function OpenChangePasswordDialog(url, title, wdth, hght)

     {

                                                var options = {

                         url: url,

                         title: title,

                         allowMaximize: false,

                        showClose: true,

                        width: wdth,

                         height: hght,

                        dialogReturnValueCallback: CloseWindowCallback

                        };

                    SP.UI.ModalDialog.showModalDialog(options);

                    return false;

    }

function CloseWindowCallback(dialogResult, returnValue)

    {

         if(dialogResult == SP.UI.DialogResult.OK)

        {

            SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);

this.statusId = SP.UI
            .Status
            .addStatus(“Password Changed”,
               “Your password has been changed. Use it next time when you log in.”,
                true);

        SP.UI.Status.setStatusPriColor(this.statusId, “Green”);

         }

    }

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s