.NET Framework Class Library
WebControlIsEnabled Property

Gets a value indicating whether the control is enabled.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
Protected Friend ReadOnly Property IsEnabled As [%$TOPIC/b4cas253_en-us_VS_110_1_0_0_0_0%]
protected internal [%$TOPIC/b4cas253_en-us_VS_110_1_0_1_0_0%] IsEnabled { get; }
protected public:
property [%$TOPIC/b4cas253_en-us_VS_110_1_0_2_0_0%] IsEnabled {
	[%$TOPIC/b4cas253_en-us_VS_110_1_0_2_0_1%] get ();
member IsEnabled : [%$TOPIC/b4cas253_en-us_VS_110_1_0_3_0_0%] with get
function get IsEnabled () : [%$TOPIC/b4cas253_en-us_VS_110_1_0_4_0_0%]

Property Value

Type: SystemBoolean
true if the WebControl object is enabled; otherwise, false.

This is a read-only property. If you want to disable a control, you set its Enabled property to false.

If a control is not contained by another control, the value of the IsEnabled property is always the same as the value of the Enabled property.

The IsEnabled property has a value that is different from the Enabled property if a control is a child of another control and if all the following circumstances are true:

  • The value of the Enabled property or the IsEnabled property of the parent control is false.

  • The Enabled property of the child control is set to true.

In this situation, the child control inherits the disabled state of the parent control. The IsEnabled property of the child control returns false to indicate that the control is disabled even though the child control was not explicitly disabled by setting its Enabled property to false. The parent control itself might have its Enabled property set to true but might inherit the disabled state from its parent, and so on.

When ASP.NET renders HTML elements for a server control, it marks the elements as disabled by setting their disabled attribute or their CSS class attribute. For more information, see SupportsDisabledAttribute and ControlRenderingCompatibilityVersion.

Version Information

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0