asp.net-mvc-4asp.net-membership

The required anti-forgery form field "__RequestVerificationToken" is not present Error in user Registration


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

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

How can I fix this?


Solution

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