我正在使用Asp.net MVC 3应用程序,其中我有一个在帐户控制器中注销的方法。如果用户会话在服务器上过期,应该从应用程序中注销用户
public ActionResult LogOff()
{
try
{
// Session.User = null;
this._authenticationService.SignOut();
return RedirectToAction("Login", "Account");
}
catch (Exception e)
{
return View("Error");
}
}
我想打电话从Session_End中的方法将此方法的global.asax.cs或是否有任何其他的方式来调用RedirectToAction("Login", "Account");
从的global.asax.cs文件。
你试图做一些用户的要求之外? (还要注意[Session_End没有为SQL /状态服务会话状态解雇](http://stackoverflow.com/questions/852942/how-do-you-programatically-end-a-session-in-asp-net) )。 – 2013-02-13 06:08:37