Error while submitting form on Kentico 12 MVC

Geo Neeliyara asked on July 27, 2021 12:08

Hi,

We are using Kentico 12 MVC (v12.0.93)

I have an issue while submitting the form. I am getting following error. We have load balancing setup on server. The form works fine on other pages except this one page as the form loads using partial widget. I applied the machine key as per the guildlines ( https://docs.xperience.io/k12sp/configuring-kentico/setting-up-web-farms/configuring-web-farm-servers#Configuringwebfarmservers-ConfiguringthemachineKeyelementinweb.config ). But still i am getting the following error. Do you have any idea on this?

Message: The required anti-forgery cookie "__RequestVerificationToken" is not present.

Exception type: System.Web.Mvc.HttpAntiForgeryException Stack trace: at System.Web.Helpers.AntiXsrf.TokenValidator.ValidateTokens(HttpContextBase httpContext, IIdentity identity, AntiForgeryToken sessionToken, AntiForgeryToken fieldToken) at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.Validate(HttpContextBase httpContext) at System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.b__19(AsyncCallback asyncCallback, Object asyncState)


Recent Answers


Sean Wright answered on August 14, 2021 19:32

Without many more additional details about your custom Page Builder use-case, it's impossible to know what the problem is.

Check the rendered HTML of the form to see if there is a hidden Anti-forgery token input field. If not then the call to @Html.AntiForgeryToken() for the form is missing.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.