C
charliewest
I've configured a RangeValidator control on a WebForm, and
have set the base-compare-validator-type to string, the max value to 100,
and min value to 1 (assuming that this will ensure that the string length is
between 1 and 100). However, the control to validate always throws an error,
regardless of the
length of the string. For example...
<asp:textbox id="txtQuestion" runat="server" Width="400px" MaxLength="100"
Height="50px" TextMode="MultiLine" CssClass="text1"></asp:textbox>
<asp:RangeValidator id="RangeValidatorQuestion1" runat="server"
ControlToValidate="txtQuestion" ErrorMessage="Question length cannot exceed
100 characters." MinimumValue="1" MaximumValue="100">*</asp:RangeValidator>
<asp:Button id="btnSubmit" runat="server" Text="Button"
CausesValidation="true"></asp:Button>
Is the RangeValidator unable to validate string lengths? And, i assume that
since the textbox's textmode is set to multiline, that the maxlength property
is disabled?
Thanks,
have set the base-compare-validator-type to string, the max value to 100,
and min value to 1 (assuming that this will ensure that the string length is
between 1 and 100). However, the control to validate always throws an error,
regardless of the
length of the string. For example...
<asp:textbox id="txtQuestion" runat="server" Width="400px" MaxLength="100"
Height="50px" TextMode="MultiLine" CssClass="text1"></asp:textbox>
<asp:RangeValidator id="RangeValidatorQuestion1" runat="server"
ControlToValidate="txtQuestion" ErrorMessage="Question length cannot exceed
100 characters." MinimumValue="1" MaximumValue="100">*</asp:RangeValidator>
<asp:Button id="btnSubmit" runat="server" Text="Button"
CausesValidation="true"></asp:Button>
Is the RangeValidator unable to validate string lengths? And, i assume that
since the textbox's textmode is set to multiline, that the maxlength property
is disabled?
Thanks,