jQuery验证没有在asp.net MVC2项目,需要MS的脚本 [英] JQuery validation without requiring MS scripts in asp.net mvc2 project

查看:106
本文介绍了jQuery验证没有在asp.net MVC2项目,需要MS的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用asp.net MVC 2的新客户端验证功能,而无需使用MS的脚本(MicrosoftAjax.js,MicrosoftMvcAjax.js,MicrosoftMvcValidation.js)?

Is it possible to use the new client side validation features of asp.net MVC 2 without having to use the MS scripts (MicrosoftAjax.js, MicrosoftMvcAjax.js, MicrosoftMvcValidation.js)?

我使用JQuery在我的申请; jQuery有进行验证一个伟大的插件,我真的不希望强制我的用户加载MS的脚本只是为了验证。

I use JQuery throughout my application; JQuery has a great plugin for validation and I don't really want to force my users to load MS scripts just for validation.

这可能吗?如果是这样,对于如何实现它的建议是AP preciated。

Is this possible? If so, any suggestions for how to accomplish it are appreciated.

推荐答案

下面是你需要在客户端上的内容:

Here's what you need on the client:

<script src="/Scripts/jquery-1.4.2.min.js" type="text/javascript" />
<script src="/Scripts/jquery.validate.min.js" type="text/javascript" />
<script src="/Scripts/MicrosoftMvcJQueryValidation.js" type="text/javascript" />

所以,不,你不需要的文件你的问题......而你肯定采取正确的路线被臃肿保持它。只需使用上面,而不是默认的上市脚本,验证应该是所有设置。 ( MicrosoftMvcJQueryValidation.js 挂钩到JSON MVC2转储页面)

So no, you don't need the files in your question...and you're definitely taking the right route keeping it from being bloated. Just by using the scripts listed above instead of the default ones, validation should be all setup. (MicrosoftMvcJQueryValidation.js hooks up to the JSON MVC2 dumps in the page)

菲尔哈克具有良好的后场深入解释它这里

这篇关于jQuery验证没有在asp.net MVC2项目,需要MS的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆