I found a Range ctor that you called fish. I could not help but investigate. (So ββI wrote this answer, like a journal, researching.)
From MSDN
public RangeAttribute( Type type, string minimum, string maximum )
Note. MSDN says Type must be IComparable . And, their approximate description speaks of his comparison of the date when he is not!
So, since I got my asp.net mvc3 application, I tried this with a date date like this:
[Range(typeof(DateTime),"1-Jan-1910","1-Jan-2060")]
When I run this, this happens:

Please note that although I set the minimum and maximum values ββwith a dotted line and not the time, it gives a different format, so its probably TryParsing string correctly? But I'm sure it cannot be ICompare two on the client side !? Now no matter what date I enter, it still shows an error. (The date is entered as March 11, 20 (20, as in 2020).)
I tried char (below) since it is also IComparable . Same. In fact, it is not possible to perform range comparison on the client side .
[Range(typeof(char), "a", "g")]
But wait ...
Just remove the customer check! I removed links to jQuery validation and unobtrusive validation and viola! It works great. These are messages , then correctly show errors when the values ββ(Both char and Date) are NOT in the specified range.
Note. Perhaps someone can expand this solution by disabling ONLY certain fields to validate the client.
Hope this was helpful.
gideon
source share