现在的位置: 首页 > 综合 > 正文

在asp.net中关闭B页面时,自动刷新A页面方法

2012年12月08日 ⁄ 综合 ⁄ 共 446字 ⁄ 字号 评论关闭

    在A页面中打开B页,B页面关闭时,重新A页面。

相关代码如下:

A页面打开B页面代码:

        Response.Write("<script>window.open('Update.aspx?customerid=" + customerid + "','','width=350,height=250,top=250,left=280');</script>");

B页面关闭并刷新A页面代码:

 

        //自动刷新前一页面,并关闭窗体
        Response.Write("<script>window.opener.location.href='AspNetPageTest.aspx';window.close();</script>");

 或者

Response.Write("<script>window.opener.location.href=window.opener.location.href;window.close();</script>");

抱歉!评论已关闭.