Web Tutorials

Interview Q & A

Code Examples

Utility Tools

ASP.NET ValidationSummary Grouping

ASP.NET ValidationSummary is useful when you want to display error message in a group rather than individual error message for each control. The ValidationSummary control belongs to System.Web.UI.WebControls

Syntax

ASP.NET ValidationSummary Control Property

PropertyDescription
ControlToValidateSpecifies control name which needs to be validate.
DisplaySpecifies behavior of the error message.
EnableClientScriptSpecifies whether or not client-side validation is enabled.
EnabledSpecifies whether or not validation control is enabled or not.
ErrorMessageSpecifies error messageto be display in validation summary.
ForeColorSpecifies error message color.
IsValidIndicate if associate control passes validation or not.
SetFocusOnErrorSet focus on associate control if validation fails.
TextSpecifies text to be display if validation fails.
ValidationGroupSpecifies validation group name.
ValidateUpdate the isvalid propery.
ValidateGetValidationPropertyDetermineing validation property of a control, if it exists.
DisplayModeSpecifies display mode of validation summary.
EnableClientScriptSet a value that indicate whether the validation summary update itsels using client-side script.
ForeColorSet fourcolor of of control.
HeaderTextSet header text displaying at top of summary.
ShowErrorMessageSet a value to display summary in line.
ValidationGroupSet a group name of control.

ASP.NET ValidationSummary Grouping Example

Above example will produce following output

RequiredFieldValidator

RegularExpressionValidator

RangValidator

CompareValidator

CustomValidator

ValidationSummary