Free Training


C Language  |  CSS  |  MainFrame  |  VBScript  |  PHP  |  XML  |  C++ Tutorials  |  Ajax  |  JavaScript  |  CSS3  |  UML  |  jQuery  |  Microsoft AJAX

VB.NET 2005 Tutorials

 
Home Tutorials VB.NET 2005
 

VB.NET Validation Controls

 

VB.NET Validation Controls - Page 3

Page 3 of 3
.
.
.




Enabling Controls Based on Input

One of the limitations of computer usage is the limitation of area that can be viewed at a given point in time. This puts the stress on visually arranging the various controls on the surface area of the screen. This disadvantage is further enhanced if the data entry in one control is incumbent upon data entry to be made in another control. One solution that is offered for overcoming this limitation is the enabling of the visible properties of the control in the event handling code wherein decision making information is being captured.

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:


Click here for Sample Code


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


Read Next: VB.NET Creating and Managing Components Part 1



 

 

Comments


jaber_souqi said:

  Can I have more about The validation with ASP.NET 2.0
September 6, 2006, 5:28 am

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
October 2, 2006, 2:35 am

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
October 16, 2007, 4:01 am

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.
March 12, 2008, 8:30 am

Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Weekly Offers

Sponsored Links