문제

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>
도움이 되었습니까?

해결책

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

CompareValidator does not work with single digit

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top