I have an MVC form which needs to validate well with javaqscript disabled on the browser as well. I am unable to get it working . Has anyone had a scenario like this?
Yes, I had Model.IsValid() and Data Annotations as well. Even then it was not firing. I was rendering my form partial as Html.Partial() as opposed to Html. Action() . I changed that and the server side validations started kicking in. When using Html.Partial() it was validating the model using Model.IsValid() but the validationsummary was not showing up at all.
MVC form
Hi,
I have an MVC form which needs to validate well with javaqscript disabled on the browser as well. I am unable to get it working . Has anyone had a scenario like this?
Any help much appreciated.
Poornima
Hi Poornima,
You can attribute your request model with some data annotations. Then the validation will also happen server side when you call
in your controller action that handles your post request
Here is some more information : http://www.asp.net/mvc/overview/older-versions/mvc-music-store/mvc-music-store-part-6
Dave
Hello Poornima
Do you already use DataAnnotations Attributes? If so it should work without scripting enabled. https://msdn.microsoft.com/en-us/library/ee256141(v=vs.100).aspx
Best regards
Frederik
Yes, I had Model.IsValid() and Data Annotations as well. Even then it was not firing. I was rendering my form partial as Html.Partial() as opposed to Html. Action() . I changed that and the server side validations started kicking in. When using Html.Partial() it was validating the model using Model.IsValid() but the validationsummary was not showing up at all.
Poornima
Glad to hear you go it solved. Don't forget to mark this post as a solution so others can find it as well
is working on a reply...