我要在后台写一个方法 当这个方法的结果为1时  就关闭当前浏览器 再重新打开一个浏览器 定位到另外一个页面 如果是2 就在当前页面打开   当前页面采用了框架  有top left right 这段代码在 left里执行大侠们救命啊,我先让他打开新的页面 他就在left里面 
我是这样写的  if (rest==1)
 {
  Response.Redirect("~/login.aspx");
 }
请高手指点

解决方案 »

  1.   

     if (rest==1)
     {
      Response.Write("<script>window.location.href='~/login.aspx';window.opener=null;window.close();</script>");
     }
      

  2.   

    if (rest==1)
     {
      Response.Write("<script>window.open('~/login.aspx','','');window.opener=null;window.close();</script>");
     }
      

  3.   

    如果你是要跳出框架的话。应该是这样写的。
    Response.Write("<script>top.location.href='/login.aspx'</script>");
      

  4.   

    if (rest==1)
     {
      Response.Write("<script>window.open('~/login.aspx','','');window.opener=null;window.open('','_self')window.close();</script>");
     }
      

  5.   

    if (rest==1)
    {
    Response.Write("<script>window.location.href='~/login.aspx';window.opener=null;window.close();</script>");
    }
    顶楼上的思路
    但是先执行  window.location.href  就直接跳转了,后面的不执行了,
    我感觉应该先打开新页再关闭
      

  6.   

    Page.ClientScript.RegisterStartupScript(this.GetType(), "open", "<script>window.open('~/login.aspx','','');window.opener=null;window.open('','_self');window.close();</script>");最终的。。
      

  7.   

    恩 是的 top left right
      

  8.   

    最终解决方案                    Page.ClientScript.RegisterStartupScript(this.GetType(), "open", "<script>window.open('~/login.aspx','','');window.open('','_self');window.parent.opener=null;window.parent.close();</script>");
    谢谢楼上的各位