Validating User Input in an ASP.NET Web Page
In ASP.NET, input validation is performed through the use of—you guessed it—Web controls. The Web controls that perform input validation are commonly called validation Web controls or just validation controls.
There are four kinds of validation controls we'll be examining in this hour. Each of these Web controls, as summarized in Table 12.1, is geared for providing one or more of the input validation classes we've just been discussing.
Validation Control | Description |
---|---|
RequiredFieldValidator | Ensures that data has been entered into a specific input |
CompareValidator | Ensures that a numeric value in one input is less than, less than or equal, equal, greater than, ... |
Get SAMS Teach Yourself ASP.NET 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.