Problem w/ RangeValidation

Discussion in 'ASP General' started by charliewest, Jan 20, 2005.

  1. charliewest

    charliewest Guest

    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,
     
    charliewest, Jan 20, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Suurkuusk
    Replies:
    0
    Views:
    3,989
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,166
    Ted Miller
    Sep 13, 2003
  3. Merek
    Replies:
    0
    Views:
    1,971
    Merek
    Dec 3, 2003
  4. Ibrahim Shameeque

    Dynamically build RangeValidation control for text box

    Ibrahim Shameeque, Dec 12, 2003, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    120
    Ibrahim Shameeque
    Dec 12, 2003
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    552
    Bullschmidt
    May 11, 2004
Loading...

Share This Page