October 2010
Intermediate to advanced
1920 pages
73h 55m
English
RequiredFieldValidator ControlThe RequiredFieldValidator control enables you to require a user to enter a value into a form field before submitting the form. You must set two important properties when using the RequiredFieldValidator control:
• ControlToValidate—
The ID of the form field validated.
• Text—
The error message displayed when validation fails.
The page in Listing 3.7 illustrates how you can use the RequiredFieldValidator control to require a user to enter both a first and last name (see Figure 3.5).
Figure 3.5. Requiring a user to enter form field values.

Listing 3.7. ShowRequiredFieldValidator.aspx
By default, the ...
Read now
Unlock full access