I have a model and have the following code in it:
public class Student
{
public int StudentId { get; set; }
[Required(ErrorMessage = "*")]
[Range(0, 100, ErrorMessage = "Value must be less than 100")]
public int Score { get; set; }
}
I want to add another error message to the Score property. Right now, it displays the message 'value must be less than 100' if a value greater than 100 is entered. But i also want to add an error message that says "the entered value must be greater than 25. I understand that i can change the Range from 0-100 to 25-100, but is there a way i can display a different error message if a value below 25 is entered?