[英]refresh base window from pop up window in asp.net
I am opening a popup window B from page A using: 我正在使用以下命令从页面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
);
I want to refresh page A whenever there is a change in popup window B . 每当弹出窗口B发生更改时,我都希望刷新页面A。
There are many ways to do it: 有很多方法可以做到这一点:
<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>
Sources: 资料来源:
Open popup and refresh parent page on close popup 打开弹出窗口,并在关闭弹出窗口时刷新父页面
http://forums.devarticles.com/javascript-development-22/auto-refresh-parent-window-after-closing-popup-4864.html http://forums.devarticles.com/javascript-development-22/auto-refresh-parent-window-after-closing-popup-4864.html
Refresh parent window when the pop-up window is closed 关闭弹出窗口时刷新父窗口
Call refreshParent
on user actions as : 以
refreshParent
在用户操作上调用refreshParent
:
function refreshParent() {
window.opener.location.href = window.opener.location.href;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.