您的 HTML 语法中有 < code> data- 属性, 看起来您页面被启用, 可以进行不受侵犯的客户端验证 。
With the traditional client-side validation javascript for the controls to be validated are generated at the server-side and passed on along with the HTML in the Response to the browser.
Hence in addition to the HTML content there will be inline script data embedded within <![CDATA[ ]]>
However with unobtrusive client-side validation instead of emitting inline javascript, it makes use of HTML5 compatible Data attributes
ASP.NET MVC 3 make use of jQuery for unobtrusive client-side validations. data-
attributes will be manipulated from jQuery functions defined within jquery.unobtrusive js
默认情况下, ASP.NET MVC 3. 将关闭无侵扰模式。 要使用此模式, 您需要启用客户端验证 & amp; 不受侵扰的 javarint 验证 。
这可以在 Web. config 中设置。
<configuration>
<appSettings>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
</configuration>