RequiredFieldValidator Control

The simplest of the validation controls is the RequiredFieldValidator control. This control, which you saw in our first example, simply checks to ensure that a value has been entered for a particular form control. If the required field is missing, this control will display its text and set the page's IsValid property to false. The control's Text should prompt the user that she needs to fill in a value for the associated control.

The RequiredFieldValidator control inherits all the BaseValidator's properties described in Table 8.1, and also exposes its own property described in Table 8.3.

Table 8.3. RequiredFieldValidator Class Additional Properties
Method Type Description
InitialValue String Used to describe the initial ...

Get ASP.NET by Example 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.