单个页面注销后返回登录首页的代码如下: 
 protected void Button6_Click(object sender, EventArgs e)  //退出登录
    {
        HttpContext.Current.Response.Cookies.Clear();
        //退出验证        System.Web.Security.FormsAuthentication.SignOut();
        //清空session
        Session.Remove("loginUserID");
        Session.Clear();
        Session.Abandon();
        //跳转
        FormsAuthentication.RedirectToLoginPage(); // 跳到登录页
    }现在我的default.aspx页面是分页的,用frameset将页面分隔了三块。而我的注销按钮触发后,整个页面没有返回到登录界面,左边的导航条left.aspx返回到登录界面了。其他的不动。现在怎么办呢?我希望注销后整个页面返回到登录界面

解决方案 »

  1.   

    protected void LinkButton1_Click(object sender, System.EventArgs e)
    {
    Session.Clear();
    Response.Write("<script>window.parent.location='login.aspx';</script>");
    }
      

  2.   


    System.Web.HttpContext.Current.Response.Write("<script>window.top.location.reload('../Admin_Login.aspx')</script>");
      

  3.   

    还有个问题:
    返回后此时是登录页面,如果你在地址栏上直接敲打default.aspx,此时页面分为两栏,左右都是登录页面,怎么办?
      

  4.   

    还有个问题:
    返回后此时是登录页面,如果你在地址栏上直接敲打default.aspx,此时页面分为两栏,左右都是登录页面,怎么办?========================================你那个default.aspx是框架页? 把验证代码写到default.aspx中就可以了
      

  5.   

    但是我的控件是在left.aspx里的,事件触发后,codebehind自动生成在left.cs里
    你说怎么写呢?