解决方法
ValidateAntiForgeryTokenAttribute将抛出
HttpAntiForgeryException.您可以使用
HandleErrorAttribute来处理这种情况:
[HandleError( ExceptionType = typeof(HttpAntiForgeryException),View = "Unauthorized")] [ValidateAntiForgeryToken] [AcceptVerbs(HttpVerbs.Post)] public ActionResult SomeActionThatRequiresToken() { return View(); }