User1806792307 posted
Hello!
I found an article that explains that RangeValidator uses a RegularExpression to validate this value.
I want to clarify something. RangeValidator does not use a regularexpression to validate a double. It uses a regular expression to extract the digits and decimal character out of the string. It then converts the result into an actual number using the javascript
parseFloat() function. If that function cannot convert, the RangeValidator knows the value was not acceptable to javascript.
I suspect that the problem is that the value you are assigning to MaximumValue is too large for javascript's floating point. I think both .net's Double and javascript are 80bit floating point but its possible they are slightly different at the min and max
range. In any case, I recommend changing your code like this:
- Use a CompareValidator, Operator=DataTypeCheck, Type=Double. It will report an illegal value due to the format or its too big for an 80 bit number.
- Use another CompareValidator, Operator=GreaterThanEqual, Type=Double, ValueToCompare= your minimum double. This will report an error if anything is below the minimum. The max was handled in the other validator.