当前位置: 代码迷 >> ASP.NET >> a.aspx页用<a>弹出新窗口,怎样用<asp:bttton>按钮关闭新窗口然后,刷新当前页获得新窗口的值解决办法
  详细解决方案

a.aspx页用<a>弹出新窗口,怎样用<asp:bttton>按钮关闭新窗口然后,刷新当前页获得新窗口的值解决办法

热度:2527   发布时间:2013-02-25 00:00:00.0
a.aspx页用<a>弹出新窗口,怎样用<asp:bttton>按钮关闭新窗口然后,刷新当前页获得新窗口的值
a.aspx用<a href="" onclick="window.open('AddAlbum.aspx','','toolbar=0,menubar=0,width=400,height=400')">创建</a>弹出b.aspx
b.aspx页怎样用<asp:bttton>按钮关闭,关闭时怎样刷新a.aspx


------解决方案--------------------------------------------------------
HTML code
    <asp:Button ID='btn' runat="server"     OnClientClick="javascript:window.opener.location=window.opener.location;window.opener=null; window.close();" />
------解决方案--------------------------------------------------------
button事件中:
//插入数据库操作
....


Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "<script>alert('插入成功');window.opener.location = window.opener.location;window.opener=null;window.close();</script>");
  相关解决方案