Chapter 12. Validating User Input with Validation Controls

In this hour, we will cover

  • The various classes of input validation

  • How to use the RequiredFieldValidator to ensure that the user has provided input

  • How to use the CompareValidator

  • How to ensure that the user’s input falls between a range of values by using the RangeValidator

  • How to use the RegularExpressionValidator

  • The aesthetic properties of the validation Web controls

As we have examined in previous hours, collecting user input through an ASP.NET page is a relatively easy task. Unfortunately, when we’re collecting a user’s input, there is no guarantee that he has provided the desired input in an acceptable format. That is, imagine that you are asking the user to specify his weight, much like ...

Get Sams Teach Yourself ASP.NET 2.0 in 24 Hours 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.