VB.NET 2005 Tutorials
Tutorials
VB.NET 2005VB.NET Validation Controls
Table of Contents
VB.NET Validation Controls
VB.NET Validation Controls - Page 2
VB.NET Validation Controls - Page 3VB.NET Validation Controls - Page 3
.
.
Enabling Controls Based on Input
Let us examine a situation where a user is trying to access some information in an application. Only data entry screen is allowed for clerks and reports alone can be accessed by the mangers. If you are neither a manager nor a clerk you cannot proceed further.
In a new project, add three radio buttons and four buttons and arrange them as in the following picture:
Add the following codes:
Click here for Sample Code
Now press F5 to execute the program. The following three screenshots show the three states of the program.



Other properties for Validation
The CharacterCasing Property
This is a property of control. It can have one of the following three values:
1. Lower auto converts all the values to lower case
2. Upper auto converts all the values to upper case
3. Normal takes the value as typed by the user.
The MaxLength Property
You can use MaxLength property to set or get the maximum number of characters allowed in the text box. You can use RequiredFieldValidator and RangeValidator to validate this property. The following code snippet shows the method of validation:
In this lesson we have looked at Exceptions and type of Exception handling routines that are available in VB.NET. In the next lesson we shall be talking of the process of Creating and Managing Components and .NET Assembly.
First Page: VB.NET Validation Controls
Comments
jaber_souqi said:

| Can I have more about The validation with ASP.NET 2.0 |
ereemye said:
|
Really good. But i have a problem with creating crystal reports. i used a wizard but it only displays the field titles with out the a vailable information in the database. Now i know am asking the right guy i will be very happy |
kushal kanal; said:
|
well .. i have readed the vb.net validation examples and i was impressed by the article which was putted on it ... now i have learnt how to validated the fields in the project ... well .. now i wanna like 2 know ... the registration form 's fields validation like a password ... etc... if any one knows it ... plz mail me the code of the registeration form validation on the rajahuja18@gmail.com |
Omar said:
| Thanks for the article on validation, the article helped very much. But I want to find out how to do d same procedure with radio buttons and combo box. Where the system forces the user to input correct values. |
