views:

728

answers:

3

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!?

+4  A: 

ASP.NET MVC Futures has not gone anywhere. :)

http://aspnet.codeplex.com/releases/view/41742

Nathan Taylor
Thanks they had just moved the link posted on all the other blogs!
tigermain
A: 

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.

tvanfosson
A: 

i think it is best to use what the framework delivers without dependancy on other frameworks

ScottGu - Enabling Client-side Validation in MVC2

SQueek
-1 Microsoft doesn't own the patent on innovation. It took forever for them to adopt any sort of reasonable javascript framework. I still find the model-based validation (server- and client-side) to be somewhat lacking in features, including many supported by the jQuery validation plugin.
tvanfosson
i didn't claim that microsoft have the patent on innovations. i think, that if validation is delivered with the framework you should use it. maybe my experience with the framework is not so deep as i first started with mvc2, so i couldn't say if validation is lacking in features. which ones are these features in your opinion? is the usage of other frameworks capable in avoiding spoofing of data? i think this is one pro argument for the provided validation.
SQueek
The whole point is that I am using his code, but dont want to be dependent on MS JS libraries when they provide support for the jQuery ones
tigermain
Also if you are already planning to leverage the rich ecosystem of jQuery plugins, it makes more sense to only use jQuery as opposed to MS Ajax. It also provides more consistency across all Javascript code.
Philippe Monnet