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”);

         }

    }

Leave a comment