读书人

.net 多个模态窗口传值有关问题

发布时间: 2013-10-18 20:53:13 作者: rapoo

.net 多个模态窗口传值问题
现有主界面form1.aspx

在form1.aspx打开一个模态窗口show1.aspx

在show1.aspx再打开另一个模态窗口show2.aspx

如何将show2.aspx的传给show1.aspx并更新show1.aspx页面

现在值已传过去,但是页面刷新一直是打开一个新页面。有什么办法解决?

我现在的方法是判断值是否为空,然后window.location跳转页面,一直跳出新窗口。

<base target="_self" /> 我也加了。
[解决办法]

1 父窗口:
<script type="text/javascript">
function openBrWindowInCentre(theURL,width,height) {
var left, top;
left = (window.screen.availWidth - width) / 2;
top = (window.screen.availHeight - height) / 2;
var per = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
window.open(theURL,'',per);
}
</script>
<a href="javascript:void(0)" onclick="openBrWindowInCentre('child.html','600','400');">打开子窗口</a>

2. 子窗口
< script language="JavaScript" type="text/javascript">
< !--
function refreshParent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow)
{
window.opener.progressWindow.close();
}
window.close();
} //-->
< /script>

< a href="javascript:void(0)" onclick="refreshParent()">刷新父窗口并关闭当前窗口</a>

读书人网 >asp.net

热点推荐