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

chen6676869 2013-10-17 08:44:34
现有主界面form1.aspx

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

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

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

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

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

<base target="_self" /> 我也加了。
...全文
117 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chen6676869 2013-10-17
  • 打赏
  • 举报
回复
哎,找了下网上资料,自己研究下

window.name = "__self";
window.open(url, "__self")
完美解决多层模态传参和更新当层模态。
u010232129 2013-10-17
  • 打赏
  • 举报
回复
加载Ajax,里面有模态对话框控件!
chen6676869 2013-10-17
  • 打赏
  • 举报
回复
引用 1 楼 cnceohjm 的回复:
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>
是三级窗口啊,不是两级的
H_Gragon 2013-10-17
  • 打赏
  • 举报
回复
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>

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧