Using jQuery for client side validation in MVC2 RTM
-
02-10-2019 - |
Question
Scott Gu's tutorial on Model validation gets us all set up with the MS client side validation using the following scripts:
<script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
However I've seen various posts allowing us to utilise jQuery instead with the following code:
<script src="https://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="https://ajax.microsoft.com/ajax/jQuery.Validate/1.6/jQuery.Validate.min.js" type="text/javascript"></script>
<script src="<%= Url.Content("~/scripts/MicrosoftMvcJQueryValidation.js") %>" type="text/javascript"></script>
However MicrosoftMvcJQueryValidation.js does not ship with the solution and from what I read it should be part of the Futures pack which is no longer available on CodePlex.
I managed to find a version alongside jQuery 1.3.2 but it does not work.
What is the forward going solution!?
Solution
ASP.NET MVC Futures has not gone anywhere. :)
OTHER TIPS
The source code for futures is still available and does include the jQuery validation js glue. I'm using in one of my projects. I downloaded the source locally -- more convenient as a reference -- and can confirm that the js file is there. Works like a charm, too.
i think it is best to use what the framework delivers without dependancy on other frameworks