User619554136 posted
I spent some time on this problem. It has two issues.
Issue1: RegexValidator can not be applied on Decimal. So thought to use RangeValidator,
So thought to use RangeValidator
Issue2: but RangeValidator does not support with Decimals. It works for only double, float, int, long.
Following is the solution for these problems, it allows NULL and specific range on Decimals.
Please observe typeof(decimal) in below snippet.
public class Data
{
[IgnoreNulls]
[RangeValidator(typeof(decimal), "0.00", RangeBoundaryType.Inclusive, "9999999.99", RangeBoundaryType.Inclusive)]
public Decimal? FederalTaxExemptionAmount { get; set; }
}