I'm validating the properties of a linq to sql entity using DataAnnotations, the properties are validating fine but the Required[ErrorMessage="error message"] ErrorMessage attribute is being ignored and instead I'm getting the default error message.
Here's the code I have so far:
[DisplayName("Nombre")]
[Required( ErrorMessage = "Este campo es requerido" )]
public string Name
{
get;
set;
}
[Required( ErrorMessage = "Este campo es requerido" )]
[Range( 0, 1000000, ErrorMessage = "Debe insertar un valor entre {1} y 1,000,000" )]
public decimal Maximum
{
get;
set;
}
[Required( ErrorMessage = "Este campo es requerido" )]
[Range( 0, 100, ErrorMessage = "Debe insertar un valor entre {1} y {2}" )]
public byte Periods
{
get;
set;
}