IsAuthenticated用户,无法访问登录页面

时间:2016-08-01 17:46:18

标签: c# asp.net asp.net-mvc

在我的网络应用程序中,我有: - 登录页面。 - CreateNewUser页面

我不想让用户在使用用户名和密码登录后访问Login和CreateNewUser页面。

  • 我应该在Login和CreateNewUsers Controller中编写类似的内容吗? -

还是有更好的方法?

if (User.Identity.IsAuthenticated)
{
    return RedirectToAction("NoAccessPage", "Account");
}

0 个答案:

没有答案
相关问题