Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    textbox exceptions

    I am creating the application for the qa dept of my company in asp.net . the main purpose of the app is to test any registration form of any website dynamically for the exceptions and errors . for example every textbox on the registration page will take in the values dynamically and if the values exceeds the maxlength of the textbox set then it should give the error . this is one of the exception i am talking about there could be many .

    now my question is that the textboxes has no built in exception mechnaism and any other control also , so how could i accomplish the task . please give any idea , or information about other tools or languages i can accomplish this task.

  • #2
    $object->toCD-R(LP); vinyl-junkie's Avatar
    Join Date
    Jun 2003
    Posts
    3,092
    Thanks
    2
    Thanked 23 Times in 23 Posts
    You can put any number of validation controls on a textbox. The one you mentioned, limiting maximum length, is easily taken care of:

    Code:
    <asp:TextBox id="username" runat="server" />
    <asp:RangeValidator id="rvusername" Type="integer"
    ControlToValidate="username"
    MaximumValue="20" MinimumValue="1"
    ErrorMessage="Please enter 1 to 20 characters"
    runat="server" />
    There is also CustomValidator, which you could use for say, a database lookup to make sure the username wasn't already taken.

    Hope this helps.
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more
    SNAP to it!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •