ASP. ValidationSummary Control
Validation server Controls
Definition and usage
The ValidationSummary control is used to display a summary of all validation errors inline in a Web page, message box, or both.
The error message that is displayed in the control is specified by the ErrorMessage property of each validation control. If the ErrorMessage property of the validation control is not set, an error message is not displayed for that validation control.
Property
Properties |
Description |
DisplayMode |
How to display the summary. Valid values are:
- BulletList
- List
- Singleparagraph
|
EnableClientScript |
Boolean value that specifies whether client-side validation is enabled. |
Enabled |
A Boolean value that specifies whether the validation control is enabled. |
ForeColor |
The foreground color of the control. |
HeaderText |
The caption text in the ValidationSummary control. |
Id |
The unique ID of the control. |
Runat |
Specifies that the control is a server control. Must be set to "server". |
ShowMessageBox |
A Boolean value that indicates whether the validation summary is displayed in a message box. |
ShowSummary |
Boolean value that specifies whether the validation summary is displayed. |
Instance
-
ValidationSummary
-
In this example, we use the ValidationSummary control to generate a list of required fields that are not filled by the user.
-
ValidationSummary 2
-
In this example, we use the ValidationSummary control to display a message box that prompts the user for a required field that is not filled in.
Validation server Controls
ASP. ValidationSummary Control