O'Reilly logo

ASP.NET Developer's JumpStart by Ken Getz, Paul D. Sheriff

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Requiring Data Entry

You'll often need to ensure that users enter a value into a control on a page. To make this easy, ASP.NET provides its RequiredFieldValidator control. On the sample page, EmpMaint.aspx, users must supply values for the First Name, Last Name, Birth Date, and Hire Date fields. Leaving any of these blank isn't allowed, and you need some way to indicate this to users. Figure 8.1 shows the sample form, after a user has attempted to submit the page by clicking Save without filling in any information. This page displays individual indicators of the fields that must be supplied.

Figure 8.1. The RequiredFieldValidator control makes it easier to avoid data fields left empty.

TIP

If you watch carefully as you test this page, you'll ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required