Improvements are done or Unobstrusive Validations is new in MVC3?

Deadly 提交于 2019-12-25 07:31:57

问题


I was reading the new features of asp.net-mvc3 and found about unobtrusive-validation.

My question is that Unobstrusive is new in asp.net-mvc3?

This SO answer says about this validation

Does it mean that Model validation is improved by introducing the new feature called Unobtrusive

or

some improvements are done in Unobtrusive validations and this feature is already available if so, can you tell what are the improvements done?


回答1:


Unobtrusiveness has to do with the way validation rules are expressed rather than with validation process itself. From Scott Gu's blog post:

Unobtrusive JavaScript avoids injecting inline JavaScript into HTML, and enables cleaner separation of behavior using the new HTML 5 “data-“ attribute convention (which conveniently works on older browsers as well – including IE6). This keeps your HTML tight and clean, and makes it easier to optionally swap out or customize JS libraries.

And yes, this way of expressing validation rules in ASP.NET MVC is there since version 3.



来源:https://stackoverflow.com/questions/16842044/improvements-are-done-or-unobstrusive-validations-is-new-in-mvc3

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