Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: textbox exceptions
12-27-2005, 08:17 AM #1
- Join Date
- Dec 2005
- Thanked 0 Times in 0 Posts
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.
12-27-2005, 02:11 PM #2
You can put any number of validation controls on a textbox. The one you mentioned, limiting maximum length, is easily taken care of:
There is also CustomValidator, which you could use for say, a database lookup to make sure the username wasn't already taken.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" />
Hope this helps.