Gets or sets a value indicating whether the Web server control is enabled.
Assembly: System.Web (in System.Web.dll)
[<BindableAttribute(true)>] [<ThemeableAttribute(false)>] abstract Enabled : bool with get, set [<BindableAttribute(true)>] [<ThemeableAttribute(false)>] override Enabled : bool with get, set
Property ValueType: System.Boolean
true if control is enabled; otherwise, false. The default is true.
This property propagates down the control hierarchy. If you disable a container control, the child controls within that container are also disabled. For more information, see the IsEnabled property.
In a custom composite control, this inheritance behavior does not apply to controls that have not yet created their child controls. You must either set the enabled state of the child controls when they are created, or override the EnsureChildControls method.property to call the
Disabling a control only prevents interaction with the control by the user through the browser UI. It is possible for a user to craft a request that submits a postback that is processed by the page even if controls on the page are disabled. Before you process a postback request, check to make sure that the control is enabled and visible.
Not all controls support this property. See the individual controls for details.
The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see ASP.NET Web Forms Page Code Model.
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview.
Available since 1.1