Asp.net关闭子窗体并刷新父窗体的方法(修改)

首先,打开子窗体的方法,从后台打开
Response.Write("<script>window.open('××.aspx',','resizable,status, width=500,height=500,none,left=300,top=250,dependent=1');</script");

然后再在打开的窗体,也就是xx.aspx子窗体的按钮事件中添加链接:
 Response.Write("<script>alert('添加成功');window.opener.location.replace(opener.location);window.close();</script>");
就可以回来父窗体。
说明:这里的主要返回的方法是window.opener.location.replace(opener.location);,返回的窗体就是opener.location,还可以指定任何窗体
名称,如window.opener.location.replace(a.aspx);,这样你就会回来 a.aspx页面并刷新 a.aspx页面
posted @ 2008-06-30 14:46  凡的世界  阅读(4501)  评论(3编辑  收藏  举报