Kentico.Forms.Web.Mvc.ValidationRule.Validate called twice on form submit

CSS Team asked on May 28, 2021 15:47

Hi everyone!

I am having some difficulties utilizing a custom validation rule. So far I have successfully managed to create a custom rule. Surprisingly it gets called twice on form submit. It seems, that my form state gets missing on the second call which makes it difficult to perform my custom validation. Does anyone have experienced this issue as well? For now I have a workaround, that stores the first validation result within the HttpContext.Items collection, but obviously I am not very happy with that.

Thanks and regards, Florian

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