阿宽

Nothing is more powerful than habit!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

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

Posted on 2008-09-19 23:43  宽田  阅读(568)  评论(0编辑  收藏  举报

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