How to: Add and Configure a RequiredFieldValidator Control
Use thecontrol to validate that the data entry field in a or control is not empty.
Required-entry validation is frequently used in conjunction with other types of validation controls. You can use as many validation controls for a user-entry field as necessary.
To validate a required entry
Add a RequiredFieldValidator control to the form that contains the target control.
Use the drop-down list next to theproperty in the Properties window to select the ID of the control to validate.
Type a text string into theproperty in the Properties window. The RequiredFieldValidator control displays this text if the user does not enter a value.
If you enter a string into theproperty, the RequiredFieldValidator control displays that text when an error occurs. If the Text property is left empty, the RequiredFieldValidator control displays the string in the ErrorMessage property.