This documentation is archived and is not being maintained.

WebPartVerb::Enabled Property

Gets or sets a value that indicates whether a verb is enabled.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

[ThemeableAttribute(false)]
public:
virtual property bool Enabled {
	bool get ();
	void set (bool value);
}

Property Value

Type: System::Boolean
true if the verb is enabled; otherwise, false. The default is true.

Use this property to get or set a value indicating whether the verb is enabled. It is useful to be able to enable or disable verbs at given points in the page and control life cycle. For example, if a developer wants to prevent users from being able to close the WebPart controls in a zone for any reason, the developer can set the Enabled property value on the CloseVerb verb to false, and then users will be prevented from closing any controls within that zone. By default, disabled verbs are rendered in verbs menus with a visual cue such as a lighter text color.

This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.

The following code example shows how to override the Enabled property in a derived class inheriting from WebPartVerb. This source code shows only the portion of the code for the custom zone and the WebPartVerb class that overrides the property. The rest of the code required to run the example can be found in the Example section of the WebPartVerb class overview.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: