System.Web.UI.WebControls.BaseValidator.ErrorMessage Property

Gets or sets the text for the error message displayed in a System.Web.UI.WebControls.ValidationSummary control when validation fails.

Syntax

[System.ComponentModel.DefaultValue("")]
[System.ComponentModel.Localizable(true)]
public string ErrorMessage { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

When using a System.Web.UI.WebControls.ValidationSummary control, use the BaseValidator.ErrorMessage property to specify the text to display in the System.Web.UI.WebControls.ValidationSummary control when validation fails for the current validation control. To specify the text to display in the validation control itself, use the BaseValidator.Text property.

Note:

If you set the BaseValidator.ErrorMessage property without setting the BaseValidator.Text property, the value of the BaseValidator.ErrorMessage property is also displayed in the validation control.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see System.ComponentModel.LocalizableAttribute and ASP.NET Globalization and Localization.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0