ASP.NET ValidationSummary Control

Definition and Usage

The ValidationSummary control is used to display the summary of all validation errors on the web page, in the 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:

  • BulletList
  • List
  • SingleParagraph
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 have not been filled in by the user.
Validationsummary 2
In this example, we used the ValidationSummary control to display a message box prompting the user to fill in the required fields that have not been filled in.