Pregunta

I have problem with CompareValidator. I need to validate input1 such that it is less than or equal to "Somepercentage" from database. The control keep showing error message when input1 is between 3-10 even when it is less than "Somepercentage". When input1 is more than 10, it works fine.

<asp:CompareValidator ID="Validator" runat="server" ErrorMessage="CompareValidator"  valueToCompare='<%# Eval("Somepercentage")%>' ControlToValidate="input1" Operator="LessThanEqual"></asp:CompareValidator>
¿Fue útil?

Solución

I found the solution. add type="Double" into asp:comparevalidator tag.

CompareValidator does not work with single digit

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top