1.跳转用 FormsAuthentication.RedirectFromLoginPage("qidongadmin.aspx", false); //指向default.aspx 不可以
但是在下面加入一个 Response.Redirect("qidongadmin.aspx");就可以,有人说是bug
还是什么原因,高寿说一下2.后台退出登陆,删除cookie信息,要加入FormsAuthentication.SignOut()   
但是前台是这么写的
<A onclick="javascript:window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();"
href="#">退出</A>
现在想在后台用代码写在一起如何写?也就是把上面的转化成后台代码,来执行

解决方案 »

  1.   

    1 2种方法应该都可以
    2 使用linkbutton,click事件
    FormsAuthentication.SignOut();
    Response.Write("<script>window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();");
      

  2.   

    Response.Write("<script>window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();</script>");
      

  3.   

    这个问题我昨晚刚解决,代码如下:
    string returnUrl=Request.QueryString["ReturnUrl"];
    if(returnUrl==null)
    returnUrl="downLoad\\download.aspx";
    Response.Redirect(returnUrl);
    这样写就没问题了
      

  4.   

    可以了,但是跳转用
    FormsAuthentication.RedirectFromLoginPage("qidongadmin.aspx", false); //指向default.aspx 不可以
    但是在下面加入一个 Response.Redirect("qidongadmin.aspx");就可以究竟是什么原因呢?
      

  5.   

    可以在Page_Load事件中加入以下代码:
    Page_Load()
    {
       ExitButton.Attribute.Add("onclick","javascript:window.open('../default.aspx','','');parent.window.opener=null;parent.window.close();");
    }用此方法可在后台代码中添加任何客户端Javascript代码
      

  6.   

    FormsAuthentication.RedirectFromLoginPage("qidongadmin.aspx", false); 
    将经过身份验证的用户重定向回最初请求的 URL 或默认 URL。
    public static void RedirectFromLoginPage (
    string userName,
    bool createPersistentCookie
    )
    所以他不会跳转至qidongadmin.aspx
    而Response.Redirect("qidongadmin.aspx");就可以