Asp.net mvc2: How to add validation rules - A number field is not required but has range limitation?
views:
102answers:
1
Q:
Asp.net mvc2: How to add validation rules - A number field is not required but has range limitation?
A:
Use the Range Attribute from DataAnnotations.
[Range(0, 255, ErrorMessage="The number must be between 0 and 255.")]
Marc Tidd
2010-05-28 23:15:22