title: MVC "LogOut" controller causes "The resource cannot be found." error when using "ValidateAntiForgeryToken" attribute
body: <p>When I add "ValidateAntiForgeryToken" attribute to my LoggOff controller, it doesn't map my controller and raises "The resource cannot be found." error. What is the problem? Here is my controller:</p>
  
  <pre><code>// POST
  [HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult LogOff()
  {
      AuthenticationManager.SignOut();
      return RedirectToAction("Index", "Home");
  }
  </code></pre>
  
  <p>Here is my view:</p>
  
  <pre><code>@using Microsoft.AspNet.Identity
  @if (Request.IsAuthenticated)
  {
      using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id =    "__RequestVerificationToken", @class = "navbar-right" }))
      {
      @Html.AntiForgeryToken()
  
      &lt;ul class="nav navbar-nav navbar-right"&gt;
          &lt;li&gt;@Html.ActionLink("User: " + User.Identity.GetUserName(), "Manage", "Account", routeValues: null, htmlAttributes: new { title = "Manage" })&lt;/li&gt;
          &lt;li&gt;@Html.ActionLink("Log Off", "LogOff", "Account")&lt;/li&gt;
      &lt;/ul&gt;
      }
  }
  else
  {
      &lt;ul class="nav navbar-nav navbar-right"&gt;
          &lt;li&gt;@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })&lt;/li&gt;
          &lt;li&gt;@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })&lt;/li&gt;
      &lt;/ul&gt;
  }
  </code></pre>