对于我们这些上传文件作为请求的一部分的另一种可能性。如果内容长度超过使用请求验证令牌的 <httpRuntime maxRequestLength="size in kilo bytes" />还有,浏览器将显示 'The required anti-forgery form field "__RequestVerificationToken" is not present'消息,而不是超过请求长度的消息。
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@Html.AntiForgeryToken()
<h4>Use a local account to log in.</h4>
总监:
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)