I am trying to display a friendly error message on form validation. I have a property with annotations in the model class:
[Required(ErrorMessage="The number attribute is required")]
public int Level { get; set; }
It does not work, but when I change the data type to string
, the annotation's error message is displayed. Does this mean that int
is not supported?