Improvements are done or Unobstrusive Validations

2019-08-28 04:35发布

I was reading the new features of and found about .

My question is that Unobstrusive is new in ?

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条回答
三岁会撩人
2楼-- · 2019-08-28 05:32

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.

查看更多
登录 后发表回答