ASP.NET ValidationSummary control
Definition and usage
The ValidationSummary control is used to display a summary of all validation errors on a web page, in a message box, or inline in both.
The error messages displayed in this control are specified by the ErrorMessage property of each validation control. If the ErrorMessage property of the validation control is not set, no error message will be displayed for that validation control.
Property
Property | Description |
---|---|
DisplayMode |
How to display the summary. Valid values include:
|
EnableClientScript | Boolean value, specifies whether to enable client-side validation. |
Enabled | Boolean value, specifies whether to enable the validation control. |
ForeColor | The foreground color of the control. |
HeaderText | The title text in the ValidationSummary control. |
id | The unique id of the control. |
runat | Specifies that the control is a server control. It must be set to "server". |
ShowMessageBox | Boolean value, indicates whether to display the validation summary in the message box. |
ShowSummary | Boolean value, specifies whether to display the validation summary. |
Example
- Validationsummary
- In this example, we used the ValidationSummary control to generate a list of required fields that the user has not filled in.
- Validationsummary 2
- In this example, we used the ValidationSummary control to display a message box to prompt the user to fill in the required fields that have not been filled in.