我試圖在用戶單擊註銷時重定向到註銷視圖,但mvc攔截重定向。要顯示FormsAuthentication.SignOut()不想重定向到註銷視圖
public ActionResult LogOff()
{
FormsAuthentication.SignOut();
return RedirectToAction("Logout", "Account");
}
public ActionResult Logout()
{
return View("LogOff");
}
標識像註銷視圖註銷
謝謝,但該代碼並沒有幫助我。它與我的功能類似。它將用戶登錄然後轉到帳戶控制器的索引操作方法。而不是我的註銷操作方法,它進入登錄,這是webconfig中的loginurl。 – CodeNoob 2012-07-23 14:49:58
這是否類似於用戶單擊LogOff之後會將其重定向到帳戶的LogOn頁面? – bot 2012-11-28 06:23:39