斯科特谷對模型驗證教程將我們全部使用以下腳本設置與MS客戶端驗證:使用jQuery在MVC2 RTM客戶端驗證
<script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>
<script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
不過,我已經看到了各個崗位,使我們用下面的代碼使用jQuery的,而不是:
<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>
然而MicrosoftMvcJQueryValidation.js不與解決方案,並從船我讀它應該是期貨的部分包而不再在CodePlex上。
我設法找到一個版本與jQuery 1.3.2一起,但它不起作用。
什麼是前進的解決方案!
這當然並不是唯一的解決辦法:(http://geekswithblogs.net/stun/archive/2010/ 02/27/asp.net-mvc-client-side-validation-summary-with-jquery-validation-plugin.aspx – 2010-05-02 13:33:54