Redirect url are not the correct - MVC 4
I'm working on a MVC 4 project with a user login page. It all works fine.
The issue is when i click on the link to log out, the redirect URL is
incorrect.
Here is the code to explain better:
View:
<a href="@Url.Action("LogOff", "Account")">Logout ?</a>
Controller:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
WebSecurity.Logout();
return RedirectToAction("Login", "Account");
}
When I click on the log out link, the URL show me this ==> Account/LogOff
But I want to redirect to this ==> Account/Login
Does anyone know what is going on?
No comments:
Post a Comment