Asp.net mvc 3 FormsAuthentication.SignOut()不希望重定向到注销视图
当用户单击注销时,我试图重定向到注销视图,但mvc截获了重定向Asp.net mvc 3 FormsAuthentication.SignOut()不希望重定向到注销视图,asp.net-mvc-3,forms-authentication,Asp.net Mvc 3,Forms Authentication,当用户单击注销时,我试图重定向到注销视图,但mvc截获了重定向 public ActionResult LogOff() { FormsAuthentication.SignOut(); return RedirectToAction("Logout", "Account"); } public ActionResult Logout() { return View("LogOff"); } 我希望注销后显示注销视图我想您已经用Authorize属性标记了完整的帐户控制器。你应该用它来修饰
public ActionResult LogOff()
{
FormsAuthentication.SignOut();
return RedirectToAction("Logout", "Account");
}
public ActionResult Logout()
{
return View("LogOff");
}
我希望注销后显示注销视图我想您已经用
Authorize
属性标记了完整的帐户控制器。你应该用它来修饰那些需要授权的操作 如果是这样的话,很难登录,但这也是我最初的想法!