日期:2014-05-18  浏览次数:20402 次

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>");