且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

不工作的ASP.NET MVC 2 RC客户端验证

更新时间:2021-12-22 22:28:00

好吧,我想通了这一点......,这是100%,我的错。虽然一对夫妇的帖子包括一些信息,我也需要。

Ok I figured this out... and it is 100% my fault. Although, a couple of the posts included some information that I did need also.

主要的问题,对此我感到惊讶没有人注意到,当时我的HTML,包括脚本......在这个职位抬头见,如果你能看到的问题。

The main problem, which I am suprised no one noticed, was my HTML to include the scripts... look up at my post and see if you can see the problem.

我使用的是<链接HREF = ... 标签,而不是正确的<脚本的src = ... 标记。完全是我的错,因为我已经在迅速剪切和粘贴不假思索的CSS链接,只是改变了类型和文件。咄!

I was using a <link href=... tag instead of the proper <script src=... tag. Totally my fault as I had quickly cut and pasted the CSS link without thinking and just changed the type and file. Duh!!!

不管怎么说所需的正确链接:

Anyways the correct links required are:

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

一切正常即可。你肯定确实需要包括来自期货项目MicrosoftMvcJQueryValidation.js'文件,所以我upvoted是提到的所有帖子。

Everything works then. You definately do need to include the 'MicrosoftMvcJQueryValidation.js' file from the futures project so I am upvoted all the posts that mentioned that.

开箱,虽然该文件不包括在内。如果你不是使用JQuery那么你可以使用下面的担心包括使用Microsoft实现,它会与钢筋混凝土框的:

Out of the box though that file is NOT included. If your not worried about using JQuery then you can just use the following includes to use the Microsoft implementation which will work out of the box with the RC:

<script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
<script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>    

我希望我可以节省至少一人悲伤一些......我仍然无法相信我怎么会搞砸了包括与没有注意到它SOOOOO长。

I hope I can save at least one person some grief... I still can't believe how I could have screwed up the include and not noticed it for sooooo long.

再次感谢您的帮助。