1  在第N(N>1)层的模态页面中,如果想链接到其他页面或者刷新当前页,只能

window.name = "__self";

    window.open(window.location.href, "__self")   //注意是2个下划线

替换 location.href

 

2  需要关闭N(N>1)层的模态窗口,并刷新第N-1层的模态页面时, 为防止刷新时弹出新窗口, 可以通过returnValue 以传递返回值给第N-1层模态窗口,来确认是否需要刷新

在按钮的提交事件中:

 多层模态窗口showModalDialog页面提交及刷新多层模态窗口showModalDialog页面提交及刷新代码

1 Response.Write("<script language='javascript'> ");
2 Response.Write("var w;if(window.dialogArguments != null)  w = window.dialogArguments;"); 
3 Response.Write("window.returnValue=1;window.close();");
4 Response.Write("</script>");
5 

 在第N-1层模态窗口内控制模态窗口的弹出并确认是否需要刷新该页面
多层模态窗口showModalDialog页面提交及刷新多层模态窗口showModalDialog页面提交及刷新代码

1 <script type="text/javascript">
2     function OpenShowDialog(id) {
3         var isReflesh = window.showModalDialog('Test.aspx?id=' + id, window, 'dialogWidth=670px;dialogHeight=250px;status:no;directories:yes;scrollbar:no;Resizable:no');
4         if (isReflesh == 1) {
5             window.name = "__self";
6             window.open(window.location.href, "__self")
7         } 
8     }
9 </script>

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2021-09-30
  • 2021-09-07
  • 2022-01-19
猜你喜欢
  • 2022-12-23
  • 2021-12-14
  • 2021-05-19
  • 2021-12-04
  • 2022-01-28
相关资源
相似解决方案