Asp.net MVC.RequestVerificationToken“;他不在场。
我的控制器如下所示:Asp.net MVC.RequestVerificationToken“;他不在场。,asp.net,asp.net-mvc,asp.net-mvc-3,asp.net-mvc-4,Asp.net,Asp.net Mvc,Asp.net Mvc 3,Asp.net Mvc 4,我的控制器如下所示: [ValidateAntiForgeryToken] [HttpGet] public ActionResult LogIn() { return View(); } @model Fancy.Management.Model.Home.LogInModel <html> <head> <title>Giriş</title> </head> <bod
[ValidateAntiForgeryToken]
[HttpGet]
public ActionResult LogIn()
{
return View();
}
@model Fancy.Management.Model.Home.LogInModel
<html>
<head>
<title>Giriş</title>
</head>
<body>
@using (Html.BeginForm())
{
<table>
<tr>
<td>Kullanıcı Adı:</td>
<td>@Html.TextBoxFor(m => m.UserName)</td>
</tr>
<tr>
<td>Şifre:</td>
<td>@Html.PasswordFor(m => m.Password)</td>
</tr>
<tr>
<td></td>
<td>
@Html.AntiForgeryToken()
<input type="submit" value="Giriş" /></td>
</tr>
</table>
}
</body>
</html>
我的观点如下:
[ValidateAntiForgeryToken]
[HttpGet]
public ActionResult LogIn()
{
return View();
}
@model Fancy.Management.Model.Home.LogInModel
<html>
<head>
<title>Giriş</title>
</head>
<body>
@using (Html.BeginForm())
{
<table>
<tr>
<td>Kullanıcı Adı:</td>
<td>@Html.TextBoxFor(m => m.UserName)</td>
</tr>
<tr>
<td>Şifre:</td>
<td>@Html.PasswordFor(m => m.Password)</td>
</tr>
<tr>
<td></td>
<td>
@Html.AntiForgeryToken()
<input type="submit" value="Giriş" /></td>
</tr>
</table>
}
</body>
</html>
@model.Management.model.Home.LogInModel
吉里什
@使用(Html.BeginForm())
{
库兰·卡德:
@Html.TextBoxFor(m=>m.UserName)
如果:
@Html.PasswordFor(m=>m.Password)
@Html.AntiForgeryToken()
}
一切看起来都很好,但我有一个例外:所需的防伪cookie“\uu RequestVerificationToken”不存在
你知道吗?一些移动设备没有执行POST,取而代之的是,GET将被执行,而不是提交令牌,exeption将被抛出。你不能在HTTP GET上使用防伪令牌。谢谢你的帮助。我的不好。你能给我看一下这句话的文档吗?实际上,在功能手机或非常旧的手机上。伪造令牌不是通行证。