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)

public:
[ThemeableAttribute(false)]
property bool Enabled {
	virtual bool get();
	virtual 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
Available since 2.0
Return to top
Show: