System.Web.UI.WebControls.BaseValidator.Enabled Property

Gets or sets a value that indicates whether the validation control is enabled.

Syntax

public override bool Enabled { set; get; }

Value

a bool

Remarks

Use the BaseValidator.Enabled property to specify whether the validation control is enabled. You can disable the validation control by setting this property to false.

Setting either the System.Web.UI.Control.Visible or the BaseValidator.Enabled property to false will prevent validation from being performed. This causes the BaseValidator.IsValid property to always evaluate to true.

The BaseValidator.Enabled property is slightly different from the System.Web.UI.Control.Visible property. If the System.Web.UI.Control.Visible property for a validation control is set to true, but the BaseValidator.Enabled property is set to false, the validation control is still rendered for client-side validation, but in a disabled state. You can then re-enable the validation control on the client by using DHTML script.

Requirements

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