View Full Version : textbox exceptions

12-27-2005, 08:17 AM
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
You can put any number of validation controls on a textbox. The one you mentioned, limiting maximum length, is easily taken care of:

<asp:TextBox id="username" runat="server" />
<asp:RangeValidator id="rvusername" Type="integer"
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.