所需的防伪cookie"__RequestVerificationToken"不存在.
我已经在cshtml和Controller中添加了
using (Html.BeginForm())
{
@Html.AntiForgeryToken()
//some code
}
[HttpGet]
[ValidateAntiForgeryToken]
public ActionResult Index()
{
using (var db = new SampleEntities())
{
return View(db.Rfps.ToList());
}
}
Run Code Online (Sandbox Code Playgroud)
Jus*_*les 34
在我的情况下,我在我的web.config中有这个:
<httpCookies requireSSL="true" />
但我的项目设置为不使用SSL.注释掉该行或设置项目以始终使用SSL解决了它.
| 归档时间: |
|
| 查看次数: |
29719 次 |
| 最近记录: |