Problem w/ RangeValidation

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top