Skip to Content
Programming Visual Basic .NET
book

Programming Visual Basic .NET

by Dave Grundgeiger
December 2001
Beginner
464 pages
13h 51m
English
O'Reilly Media, Inc.
Content preview from Programming Visual Basic .NET

Adding Validation

Validating user input is a common requirement of any application that relies on the user to provide data. The ASP.NET framework provides tools to make input validation easy. ASP.NET supports validation by providing server controls that handle the validation process. Each server control placed on a form is responsible for validating the value in some other control on the form. The validation process occurs both on the client (if the browser is capable) and on the server, or just on the server (if the browser can’t handle it). Validation occurs on the server, even if it occurs on the client, to prohibit a hostile client from submitting invalid data.

The server controls that relate to validation are:

CompareValidator

Compares the value in a control with either a constant value or the value in another control. The developer chooses the comparison to be performed (equal, less than, greater than, etc.). The validation succeeds if the comparison is True.

CustomValidator

Allows the application to perform validation logic that isn’t provided by the standard comparison controls.

RangeValidator

Compares the value in a control to a given range. The validation succeeds if the value is within the range.

RegularExpressionValidator

Compares the value in a control to a given regular expression. The validation succeeds if the value is matched by the regular expression.

RequiredFieldValidator

Checks that a value has been entered into a control. The validation succeeds if the value ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Visual Basic .NET, Second Edition

Programming Visual Basic .NET, Second Edition

Jesse Liberty

Publisher Resources

ISBN: 0596000936Supplemental ContentCatalog PageErrata