ASP.NET MVC 3 ClientValidationEnabled is not posting back to the server
I am working on an MVC 3 project and i am having issue with enabling client side validation.
In my master layout I have the following
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<开发者_StackOverflowscript src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
When i turn on client side validation in root web.config
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
then on submitting the form, the validation works but if i enter valid values on the form and submit it, it never gets posted back to the server as if the validation is failing on the client side. I can see in firebug/fiddler that nothing is posting back. Any idea?
Regards, Nabeel
Here is thought from my experience.
I experienced similar kind of situation, later found that one of the validation in the page is failing which is not explicit.
- Make sure that after you entered the input, all the input satisfy the validation
- Make sure that you have validation error message for each unique scenarios
精彩评论