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

Hemant Soni picture Hemant Soni · Apr 19, 2013 · Viewed 207.1k times · Source

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?

Answer

webdeveloper picture webdeveloper · Apr 19, 2013

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