3
I am trying to use the logoff function offered by default in Identity:
// POST: /Account/LogOff
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
return RedirectToAction("Index", "Home");
But every time I try to call this function it returns this error :
Server Error in Application '/'.
And it says the requested URL was :
Requested URL: /Manage/Logoff
To call this Action I used the following method :
@if (User.Identity.IsAuthenticated) {<li>@Html.ActionLink("Sair", "LogOff", "AccountController", FormMethod.Post)</li> }
Instead of calling to Accountcontroller I tried to use only Account as described in the function comment // POST: /Account/Logoff, but I was not successful.
To make this work I must call it another way ? or write a different method to perform the logoff ?
Your "Account" controller inherits from some other?
– Good Bye Blue sky
public class Accountcontroller : Controller
– Prostetnic Vogon Jeltz