I used a RangeValidator with ValidatorControl set to a DropDownList control that is filled and controlled by a CascadingDropdown control.
I've set CascadingDropdown's "PromptValue" and "EmptyValue" to "-1" and set RangeValidator's "MinimumValue" to "0" and "MaximumValue" to "32767".
Even if I select any value zero or greater it still shows "ValidationErrorMessage" untill its 2 figure number i.e. greater than 9.
I've added a client side "onchange" event on combo with alert to check the actual selected value its showing correct value greater than zero but validator doesn't validate correctly.
Code Snippet
<asp:DropDownList ID="cmbSite" runat="server" Height="16px" Width="196px">
</asp:DropDownList>
<cc1:CascadingDropDown ID="AJCmbSite" TargetControlID="cmbSite" ParentControlID="cmbCompany" Category="Site" PromptText="Select site" PromptValue="-1" EmptyText="No site" EmptyValue="-1" LoadingText="Loading wait..." ServiceMethod="GetSites" runat="server" >
</cc1:CascadingDropDown>
<asp:RangeValidator ID="RangeValidator2" runat="server"
ControlToValidate="cmbSite" ErrorMessage="Select the site for department"
MaximumValue="32767" MinimumValue="0"></asp:RangeValidator>
Comments: This ticket was filed for a pre-15.1 version of AJAX Control Toolkit. If this is still an issue in v15.1 or later, please create a new inquiry.
I've set CascadingDropdown's "PromptValue" and "EmptyValue" to "-1" and set RangeValidator's "MinimumValue" to "0" and "MaximumValue" to "32767".
Even if I select any value zero or greater it still shows "ValidationErrorMessage" untill its 2 figure number i.e. greater than 9.
I've added a client side "onchange" event on combo with alert to check the actual selected value its showing correct value greater than zero but validator doesn't validate correctly.
Code Snippet
<asp:DropDownList ID="cmbSite" runat="server" Height="16px" Width="196px">
</asp:DropDownList>
<cc1:CascadingDropDown ID="AJCmbSite" TargetControlID="cmbSite" ParentControlID="cmbCompany" Category="Site" PromptText="Select site" PromptValue="-1" EmptyText="No site" EmptyValue="-1" LoadingText="Loading wait..." ServiceMethod="GetSites" runat="server" >
</cc1:CascadingDropDown>
<asp:RangeValidator ID="RangeValidator2" runat="server"
ControlToValidate="cmbSite" ErrorMessage="Select the site for department"
MaximumValue="32767" MinimumValue="0"></asp:RangeValidator>
Comments: This ticket was filed for a pre-15.1 version of AJAX Control Toolkit. If this is still an issue in v15.1 or later, please create a new inquiry.