Is the DataTypeAttribute validation working in MVC2?

Posted by Wayne on Stack Overflow See other posts from Stack Overflow or by Wayne
Published on 2010-03-06T05:16:01Z Indexed on 2010/04/14 1:43 UTC
Read the original article Hit count: 376

As far as I know the System.ComponentModel.DataAnnotations.DataTypeAttribute not works in model validation in MVC v1. For example,

public class Model
{
  [DataType("EmailAddress")]
  public string Email {get; set;}
}

In the codes above, the Email property will not be validated in MVC v1. Is it working in MVC v2?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about validation