2013-01-04 131 views

回答

1

您注销链接按钮的代码记录中应该何时实施:

//sign out from form authentication 

FormsAuthentication.SignOut(); 

//abandon session 

Session.Abandon(); 

Response.Redirect("logon.aspx"); 

你可以在以下链接找到更多的细节。 Log-Out using form Authentication

0

这些东西应该OUT-

FormsAuthentication.SignOut(); //Removes the forms-authentication ticket from the browser. 
Session.Clear();    //clear all session values 
Session.Abandon();    //Remove session objects 

FormsAuthentication.RedirectToLoginPage(); //redirect the user back to the login page 
//OR 
Response.Redirect("/Default.aspx"); //whichever page you need. 
+0

我想为FormsAuthentication.RedirectToLoginPage()设置默认页面。它的重定向到login.aspx,但我没有login.aspx页面。我如何设置? –

+0

我在默认页面上创建了登录面板。 –

+0

更新了答案.. – Cdeez