开发者

Ajax.BeignForm() and re-referencing necessary scripts?

开发者 https://www.devze.com 2023-03-31 18:26 出处:网络
I created a partial view which consist of an Ajax.BeignForm(), as far as I read about it, to make client side validation work, I should reference these scripts :

I created a partial view which consist of an Ajax.BeignForm(), as far as I read about it, to make client side validation work, I should reference these scripts :

<script src="<%: Url.Content("~/Scripts/jquery-1.5.1.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.valid开发者_如何学Cate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

Even though I already referenced them in view which calls the partial view (the one which consist Ajax.BeignForm()), I should re-reference them. But It made a problem which take two days of me, and cause the problem I described here, and that problem only solves by removing above scripts, And removing them causes the client side validation not to work. Do you have Any Idea ?


Don't forget these guys:

<configuration>
    <appSettings>
        <add key="ClientValidationEnabled" value="true"/>
        <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
    </appSettings>
</configuration>


Did you add these 2 keys to your appSettings:

    <add key="ClientValidationEnabled" value="true"/>
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>

And no, if you have those scripts on the page already, you shouldn't have to add them again.

0

精彩评论

暂无评论...
验证码 换一张
取 消