Just to make sure the problem is not with Umbraco I have installed a brand new version 8.2 and had a simple form and the validation worked like a charm.
So that meant the validation issue is very specific to my solution. after a lot of Googling, I realised my solution (as it was a migration from v7 to v8.2) has a reference to Ninject Dependency Injection as well as LightInject which is the new DI that is shipped with Umbraco 8.
So by getting rid of all NuGet packages related to Ninject and removing the code, finally the validation started to work Yayyyy!!!
ModelState.IsValid is always true in Umbraco v8.2
Hi all,
I have a simple form and a simple view model class with required attributes as follow:
and then in the view I have this:
When the form is posted the
ModelState.IsValid
is always true, even all of the fields are empty.The same form used to work in Umbraco 7.15.3 but not in Umbraco 8.2
So I am not sure if the problem is with Umbraco version 8.2 or I am missing something in the code.
Thanks
Ali
Just to make sure the problem is not with Umbraco I have installed a brand new version 8.2 and had a simple form and the validation worked like a charm.
So that meant the validation issue is very specific to my solution. after a lot of Googling, I realised my solution (as it was a migration from v7 to v8.2) has a reference to Ninject Dependency Injection as well as LightInject which is the new DI that is shipped with Umbraco 8.
So by getting rid of all NuGet packages related to Ninject and removing the code, finally the validation started to work Yayyyy!!!
is working on a reply...