JQuery validation without requiring MS scripts in asp.net mvc2 project

前端 未结 1 881
终归单人心
终归单人心 2021-01-12 15:21

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, MicrosoftMvcValid

相关标签:
1条回答
  • 2021-01-12 16:04

    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" />
    

    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)

    Phil Haack has a good post explaining it more in-depth here

    0 讨论(0)
提交回复
热议问题