Validating User Input
What You Will Learn in This Chapter:
- What user input is and why it's important to validate it
- What ASP.NET 4.5 has to offer to aid you in validating user input
- How to work with the built-in validation controls and how to create solutions that are not supported out of the box
- How to send e-mail using ASP.NET
- How to read text files
Wrox.com Code Downloads for this Chapter
You can find the wrox.com code downloads for this chapter on the Download Code tab at www.wrox.com/remtitle.cgi?isbn=1118311809. The code is in the Chapter 9 download.
So far you have been creating a fairly static website where you control the layout and content by adding fixed pages to the site and its navigation menus. But you can make your site a lot more attractive by incorporating dynamic data. This data usually flows in two directions: it either comes from the server and is sent to the end user's browser, or the data is entered by the user and sent to the server to be processed or stored.
Data coming from the server can be retrieved from many different data sources, including files and databases, and is often presented with the ASP.NET data controls. You see how to access databases in Chapter 12 and onward.
The other flow of data comes from the user and is sent to the server. The scope of this information is quite broad, ranging from simple page requests and “Contact Us” forms to complex shopping cart scenarios and wizard-like user interfaces, but the underlying principle ...