I would like to know what is the easiest way to have a \"Greater Than\" & \"Lower Than\" validation on a ASP.NET MVC 3 form?
I use unobtrusive JavaScript for client
You can use the DateGreaterThanEqual attribute in your model. Here is a snippet of code that I used to validate two fields in my form.
[DataType(DataType.Date)]
[DisplayName("From Date")]
public DateTime? StartDate { get; set; }
[DataType(DataType.Date)]
[DisplayName("To Date")]
[DateGreaterThanEqual("StartDate")]
public DateTime? EndDate { get; set; }