asp.net.ph

BaseValidator.Enabled Property

System.Web.UI.WebControls Namespace   BaseValidator Class


Sets or retrieves a value specifying whether the validation control is enabled.

Syntax


Inline <asp:validator enabled [ = true | false ] ... >
Script Validator.Enabled [ = true | false ]

Property Value

This property accepts or returns only a boolean value: true if validation for the control is enabled; otherwise false. Default value is true.

Remarks

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

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

The Enabled property is slightly different from the Control.Visible property. If the Control.Visible property for a validation control is set to true, but the 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 client-side script.

Example

The following example demonstrates how to programmatically set the Enabled property to enable or disable a validation control on the Web page at run time.

 Show me 

See Also

BaseValidator Members   Base Validation Control Properties   Disabling Validation at Run Time Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph