views:

29

answers:

1
[MetadataType(typeof(PersonMetaData))]
public partial class Person {
    public class PersonMetaData {
        [Required(ErrorMessage="The number is required")]
        public object Number {get;set;}
    }
}

This error message is shown when the number field is empty and when there's an invalid input it gives "The value 'foo' is not valid for Number.". How can I customize the latter error message?