当我使用SP.UI.ModalDialog.OpenPopUpPage时如何刷新父页面?

时间:2012-07-23 04:18:06

标签: c# sharepoint

我使用此页面( PageA.aspx )打开一个对话框(让我们说 DialogA.aspx

function OpenCustomDialog(dialogUrl, dialogWidth, dialogHeight, dialogTitle, dialogAllowMaximize, dialogShowClose) {

    var options = {
        url: dialogUrl,
        allowMaximize: dialogAllowMaximize,
        showClose: dialogShowClose,
        width: dialogWidth,
        height: dialogHeight,
        title: dialogTitle,
        dialogReturnValueCallback: Function.createDelegate(null, CloseCallback3)
    };
    SP.UI.ModalDialog.showModalDialog(options);
}

从该对话框中,我尝试使用此

打开另一个弹出窗口

函数OpenPopupInDialog(dialogUrl,dialogWidth,dialogHeight){

SP.UI.ModalDialog.OpenPopUpPage(dialogUrl, null, dialogWidth, dialogHeight);

}

但是当我关闭弹出窗口时,我想刷新 DialogA.aspx

我该怎么做?

不过,我还是SharePoint新手。

1 个答案:

答案 0 :(得分:2)

您可以从那里添加实现自己的关闭回调和刷新页面。

请参阅此链接了解更多详情:http://antoniolanaro.blogspot.com/2011/04/open-sharepoint-2010-modal-dialog-and.html

<强>更新 根据{{​​3}},第二个参数是对对话框关闭时要调用的函数的回调。 我想你可以尝试这样做:

    要刷新的页面上的
  • (在这种情况下为 DialogA.aspx ),您可以添加刷新页面的功能,即

    function CustomPageRefresh(dialogResult, returnValue) {
        document.location.reload(); //or another method you need to refresh the page in your case
    }
    
  • 在同一页面上,将OpenPopupInDialog更改为以下内容:

    function OpenPopupInDialog(dialogUrl, dialogWidth, dialogHeight) {
        SP.UI.ModalDialog.OpenPopUpPage(dialogUrl, CustomPageRefresh, dialogWidth, dialogHeight);
    }