We are going to start by demonstrating the problem that validation solves: preventing the user from entering nonsensical data into form fields. To do this, we will use the swimming calculator example again. Listing 17-1 contains the markup for the
Default.aspx page, added to a Visual Studio project created using the Empty ASP.NET Application template.
Listing 17-1. The markup for Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebFormsApp.Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ...