title: How to catch HttpAntiForgeryException in ASP.NET MVC
body: <p>I'm using the AntiForgeryToken in my ASP.NET MVC forms. If I deactivate cookies in my browser and send the from, I'd get following error message:</p>
  
  <p><strong>A required anti-forgery token was not supplied or was invalid.</strong></p>
  
  <p>How can I prevent this message from showing? I would prefer redirecting the user to another page.</p>
  
  <p>I've activated customErrors and included this HandleError in my controller:</p>
  
  <pre><code>[HandleError(ExceptionType=typeof(HttpAntiForgeryException), View="Index")]
  public class MyController : Controller
  {
  ...
  }
  </code></pre>
  
  <p>The HandleError is ignored.</p>
  
  <p>Has anyone got a solution?</p>