Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8071449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:41:48+00:00 2026-06-05T13:41:48+00:00

when i set range of my text box i get error when i remove

  • 0

when i set range of my text box i get error when i remove or comment it page runs kindly see my code and tell me error in it.

<asp:TextBox ID="TxtName" runat="server" ValidationGroup="Adduser" MaxLength="32"
                        Width="200px"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="Adduser"
                        ErrorMessage="Provide user name" ControlToValidate="TxtName" Display="Dynamic">*</asp:RequiredFieldValidator>
                        <%--<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ValidationGroup="Adduser" ControlToValidate="TxtName" ErrorMessage="User ID Must be at least 8 Alpha Numeric Characters." ValidationExpression="^[a-zA-Z0-9]{8,}$">*</asp:RegularExpressionValidator>--%>
                    <asp:RangeValidator ID="RangeValidator2" runat="server" ErrorMessage="The ID Must Be 8 Characters." MaximumValue="32" MinimumValue="8" ControlToValidate="TxtName" Type="String"></asp:RangeValidator>
                </td>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:41:48+00:00Added an answer on June 5, 2026 at 1:41 pm

    You shouldn’t use RangeValidator for String type instead use RegularExpressionValidator

    Try this,

    <asp:TextBox ID="TxtName" 
                 runat="server" 
                 ValidationGroup="Adduser" 
                 MaxLength="32"
                 Width="200px"></asp:TextBox>
    
    <asp:RegularExpressionValidator 
                 ID="RegularExpressionValidator2" 
                 runat="server" 
                 ValidationGroup="Adduser" 
                 ControlToValidate="TxtName" 
                 ErrorMessage="User ID Must be at least 8 Alpha Numeric Characters."
                 ValidationExpression="[a-zA-Z0-9]{8}">*</asp:RegularExpressionValidator>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to set a Range Validator on a text box to prevent someone
I'm iterating through a collection of asp:tablerows to be able to get or set
I want to set minValue and maxValue of text boxes to define a range
I am going to use a HSlider to set a range of values. I
My animation is 100 frames total. I want to set a range of frames.
Is it possible to use or adapt jQuery's .select() to set a selection range
I'm trying to group a set of data based on the range of an
I have a large set of numbers, probably in the multiple gigabytes range. First
I have a range named STATE. I want to set data validation in range
I'm trying to generate a set of 100 random integers between a fixed range.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.