Performing Manual Validation

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"images  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ...

Get Applied ASP.NET 4 in Context 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.