【问题标题】:FormsAuthentication.SignOut() does not want to redirect to logout viewFormsAuthentication.SignOut() 不想重定向到注销视图
【发布时间】:2012-07-23 13:55:01
【问题描述】:

当用户单击注销但 mvc 拦截重定向时,我正在尝试重定向到注销视图。

public ActionResult LogOff()
{
FormsAuthentication.SignOut();
return RedirectToAction("Logout", "Account"); 
}

public ActionResult Logout()
{
return View("LogOff");
}

我喜欢注销后显示的 LogOff 视图

【问题讨论】:

    标签: asp.net-mvc-3 forms-authentication


    【解决方案1】:

    我猜你已经用Authorize 属性标记了完整的帐户控制器。您应该只装饰需要授权的操作。

    【讨论】:

    • 如果是这样的话有点难以登录,但这也是我最初的想法!
    猜你喜欢
    • 2021-12-20
    • 2010-09-29
    • 2013-02-15
    • 1970-01-01
    • 1970-01-01
    • 2014-06-07
    • 2017-06-01
    • 2012-11-05
    相关资源
    最近更新 更多