A:主页index.aspx
B:框架页
C:框架页的子页之一
A连接到B,B内连接C,当我在C中做完操作,想退出当前框架页,返回主页index.aspx,咋搞。如果我在C中的一个按钮写response.redirect("~/index.aspx"),结果仍然是在框架内显示index.aspx
因为我退出C要做一些代码处理(如session的处理,数据库的更新),所以想用按钮完成。

解决方案 »

  1.   

    <script type="text/javascript">
            function TranToMain()
            {
                window.parent.main.location="~/index.aspx";
            }
        </script>后台的话可以调用前台该js函数
      

  2.   

    response.redirect("~/index.aspx")=>Response.Write("<script>top.location='index.aspx'</script>");
      

  3.   

    Response.Write("<script>top.location.href='index.aspx';</script>");
      

  4.   

    用js即可,top.location.href = 'index.aspx';
      

  5.   

    Response.Write("<script>top.location.href='index.aspx';</script>");