开发者

What new DataAnnotations are included in ASP.NET MVC2?

开发者 https://www.devze.com 2023-01-03 06:05 出处:网络
I\'m reading about enhacement开发者_如何学Gos in ASP.NET MVC 2, and as we see, there is a topic about \"Support for DataAnnotations Attributes\": RangeAttribute, RequiredAttribute, StringLengthAttribu

I'm reading about enhacement开发者_如何学Gos in ASP.NET MVC 2, and as we see, there is a topic about "Support for DataAnnotations Attributes": RangeAttribute, RequiredAttribute, StringLengthAttribute, and RegexAttribute. Were they available in MVC v1 ?


The DataAnnotations attributes lie in namespace System.ComponentModel.DataAnnotations. The ASP.NET MVC 2 includes built in support for the DataAnnotation validation. ASP.NET MVC 1 not support built in DataAnnotation support(for validation), it needs Data Annotations Model Binder as described here.

0

精彩评论

暂无评论...
验证码 换一张
取 消