why does ASP.Net MVC Range Attribute take a Type?
I was just wondering why the Range validation attribute can take a Type and two strings as parameters? Is this for validating strings against an Enum or something like this? Also what I am trying to do is find an easy way to validate a 3 character string which must be present in an enum, any sugestions? Thanks, Alex. I did find the Range ctor you mentioned fishy. Couldn't help but investigate. (So I wrote this answer like a log while investigating.) From MSDN public RangeAttribute( Type type, string minimum, string maximum ) Note : MSDN says the Type should be IComparable . And, their example