Hour 12. Validating User Input with Validation Controls

As we have examined in the previous hours, collecting user input via an ASP.NET Web page is a relatively easy task. Unfortunately, when collecting such input, there is no guarantee that the user has provided the desired input in an acceptable format. Imagine that you are asking the user to specify weight, much like we did with the BMI calculator a few hours ago. What should happen if, for weight, the user enters something like “Far too much”?

Ensuring that user input is in a proper format, a technique known as input validation, is the topic for this hour. If you have had experience with other dynamic Web page creation technologies, such as ASP, PHP, or JSP, you likely are more than familiar ...

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.