Wednesday, April 11, 2012

DataAnnotationsExtensionsMVC3 validation not working on Integer value

Getting default error message for int datatype
i.e he value 'abc' is not valid for age

What should i do.



   public class HomeViewModel
{
[Integer(ErrorMessage="provide valid numeric value")}
public int age{ get; set; }
}




No comments:

Post a Comment