所需的防伪表单字段" __ RequestVerificationToken"是不是在用户注册present错误 [英] The required anti-forgery form field "__RequestVerificationToken" is not present Error in user Registration

查看:2366
本文介绍了所需的防伪表单字段" __ RequestVerificationToken"是不是在用户注册present错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Membership.create 用户的功能,那么下面的错误发生,

I am using Membership.create user function, then the following error is occurring,

所需的防伪型窗体域__RequestVerificationToken是
  没有present

The required anti-forgery form field "__RequestVerificationToken" is not present

我该如何解决这个问题?

How can I fix this?

推荐答案

您有 [ValidateAntiForgeryToken] 属性。您还应该添加 @ Html.AntiForgeryToken()在表单中。

You have [ValidateAntiForgeryToken] attribute before your action. You also should add @Html.AntiForgeryToken() in your form.

这篇关于所需的防伪表单字段" __ RequestVerificationToken"是不是在用户注册present错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆