How do I turn off client side validation in MVC 3?

大兔子大兔子 提交于 2019-12-02 03:16:32

enable unobtrusive and disable clientvalidation.

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

I just tried it (actually with both false) and it works fine. Its possible your page was being cached as well. I recommend keeping UnobtrusiveJavaScriptEnabled=true because of the lighter ajax attributes it adds.

Disable it in your web.config:

<appSettings>
  <add key="ClientValidationEnabled" value="false"/>
</appSettings>

For me it looks like the setting needed to be set in the base web.config. IT SEEMS TO BE IGNORED IF YOU TRY TO SET IT IN THE VIEW web.config FILE!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!