【发布时间】:2012-08-08 05:10:38
【问题描述】:
查看了这里的所有帖子,但没有一个能解决我的问题。
我点击网址:/Users/KickOutUser
public void KickOutUser()
{
TempData["ErrorMessage"] = "You need to be logged in to access that content";
//Redirect to Login
RedirectToAction("Login");
}
/*user controller*/
public ActionResult Login()
{
//E.G ErrorMessage comes from HandleUnauthenticatedUser
ViewData["ErrorMessage"] = TempData["ErrorMessage"] ?? null;
return View();
}
通过调试,我可以看到它点击了第一个方法,然后重定向,但重定向调用从不调用 Login 方法,我最终得到一个空白视图..
【问题讨论】:
标签: asp.net asp.net-mvc-4