您的位置:首页 > 编程语言 > ASP

Asp.net window.open弹出子窗体,刷新主窗体

2011-07-19 11:00 453 查看
首先,打开子窗体的方法,从后台打开
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页面
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐