I am using Membership.create
user function, then the following error is occurring,
The required anti-forgery form field \"__RequestVerifi
In my case it was due to adding requireSSL=true
to httpcookies
in webconfig which made the AntiForgeryToken stop working. Example:
To make both requireSSL=true
and @Html.AntiForgeryToken()
work I added this line inside the Application_BeginRequest
in Global.asax
protected void Application_BeginRequest(object sender, EventArgs e)
{
AntiForgeryConfig.RequireSsl = HttpContext.Current.Request.IsSecureConnection;
}