in c# metro app DataType validation using System.ComponentModel.DataAnnotations is not working

Sep 21, 2012 at 11:54 AM


I am working in metro application using C#.I am using System.ComponentModel.DataAnnotations for validation purpose. RegularExpression , StringLength , Required and Range are working fine but what about DataType validation? 

what i do is something like : 

[DataType(System.ComponentModel.DataAnnotations.DataType.PhoneNumber, ErrorMessage = "Only No is allowed")]
public string PhoneNumber_Validation { get; set; }

but it's not working.i mean what about other validation??how to create customeValidation?? any one can help plz...