繁体   English   中英

从asp.net的弹出窗口刷新基本窗口

[英]refresh base window from pop up window in asp.net

我正在使用以下命令从页面A打开弹出窗口B

this.Page.ClientScript.RegisterStartupScript(  
      this.GetType(), 
      "JavaScript", 
     "myWindow=window.open('B.aspx',
     'WindowName',
     'copyhistory=no, 
     width=800, 
     height=300, 
     top=150, 
     left=50, 
     resizable=1, 
     scrollbars=1');
     myWindow.focus();", 
     true
);

每当弹出窗口B发生更改时,我都希望刷新页面A。

有很多方法可以做到这一点:

<script>
    window.onunload = refreshParent;
    function refreshParent() {
        window.opener.location.reload();
    }
</script>

<script language="JavaScript">
<!--
function refreshParent() {
  window.opener.location.href = window.opener.location.href;

  if (window.opener.progressWindow)

 {
    window.opener.progressWindow.close()
  }
  window.close();
}
//-->
</script>

资料来源:

打开弹出窗口,并在关闭弹出窗口时刷新父页面

http://forums.devarticles.com/javascript-development-22/auto-refresh-parent-window-after-closing-popup-4864.html

关闭弹出窗口时刷新父窗口

refreshParent在用户操作上调用refreshParent

function refreshParent() {
     window.opener.location.href = window.opener.location.href;
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM