Chapter 7. Validation Server Controls

When you look at the Toolbox window in Visual Studio 2005—especially if you've read Chapters 5 and 6, which cover the various server controls at your disposal—you may be struck by the number of server controls that come with ASP.NET 2.0. This chapter takes a look at a specific type of server control you find in the Toolbox window: the validation server control.

Validation server controls are a series of controls that enable you to work with the information your end users input into the form elements of the applications you build. These controls work to ensure the validity of the data being placed in the form.

Before learning how to use these controls, however, take a look at the process of validation to learn what it's all about.

Understanding Validation

People have been constructing Web applications for a number of years. Usually the motivation is to provide or gather information. In this chapter, you focus on the information-gathering aspect of Web applications. If you collect data with your applications, collecting valid data should be important to you. If the information isn't valid, there really isn't much point in collecting it.

Validation comes in degrees. Validation is a set of rules that you apply to the data you collect. These rules can be many or few and enforced either strictly or in a lax manner: It really depends on you. No perfect validation process exists because some users may find a way cheat to some degree, no matter what rules ...

Get Professional ASP.NET 2.0 Special Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.