是否已完成改进或MVC3中是否新增了非侵入式验证? [英] Improvements are done or Unobstrusive Validations is new in MVC3?

查看:91
本文介绍了是否已完成改进或MVC3中是否新增了非侵入式验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读.

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

我的问题是

这是否意味着通过引入称为Unobtrusive的新功能

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

Unobtrusive验证中做了一些改进,如果可以的话,此功能已经可用,您能告诉我们做了哪些改进吗?

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

推荐答案

不打扰性与验证规则的表达方式有关,而不与验证过程本身有关. 摘自Scott Gu的博客文章:

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

不引人注目的JavaScript避免将内嵌JavaScript注入HTML, 并使用新的HTML 5实现更清晰的行为分离 数据"属性约定(可方便地在较旧的版本上使用 浏览器-包括IE6).这可以使您的HTML保持紧密,并且 干净,并且可以更轻松地选择替换或自定义JS 库.

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.

是的,从版本3开始,就存在这种在ASP.NET MVC中表达验证规则的方式.

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

这篇关于是否已完成改进或MVC3中是否新增了非侵入式验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆