Export (0) Print
Expand All

EditorZoneBase.ApplyVerb Property

Gets a reference to a WebPartVerb object that enables end users to apply editing changes to a control in edit mode.

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

'Declaration
<PersistenceModeAttribute(PersistenceMode.InnerProperty)> _
Public Overridable ReadOnly Property ApplyVerb As WebPartVerb

Property Value

Type: System.Web.UI.WebControls.WebParts.WebPartVerb
A WebPartVerb that enables end users to apply changes to a control.

The apply verb is referenced by the ApplyVerb property on a control derived from the EditorZoneBase class. The apply verb saves editing changes that an end user has made in the editing user interface (UI) to a server control that is currently being edited. By default, the apply verb appears in the UI as a Button control. The type of button can be an image, a link, or an actual button; you can set this for all verb buttons in a zone (not for individual buttons) by setting the inherited VerbButtonType property at the zone level.

The apply verb is a zone-level control, which means that although there might be several EditorPart controls, each editing one or more properties for the server control that is in edit mode, the apply verb works universally to apply all changes from all the EditorPart controls in the zone to the server control.

The following code example demonstrates how to access the ApplyVerb property both declaratively and programmatically. For the full code required to run the example, see the Example section of the EditorZoneBase class overview topic.

The first part of the code example shows how to access the ApplyVerb property declaratively in a Web page. This example customizes the text for the verb.

<aspSample:MyEditorZone ID="EditorZone1" runat="server">
  <ApplyVerb Text="Apply Changes" />
  <CancelVerb Text="Cancel Changes" />
  <OKVerb Text="Finished" />
  <ZoneTemplate>
    <asp:AppearanceEditorPart ID="AppearanceEditorPart1" 
      runat="server" />
    <asp:LayoutEditorPart ID="LayoutEditorPart1" 
      runat="server" />
  </ZoneTemplate>
</aspSample:MyEditorZone>

The second part of the example shows how to access the ApplyVerb property programmatically, by using a toggle button to enable or disable it.

Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
  If EditorZone1.ApplyVerb.Enabled Then
    EditorZone1.ApplyVerb.Enabled = False
  Else
    EditorZone1.ApplyVerb.Enabled = True
  End If
End Sub

When you load the page in a browser, you can select Edit Mode in the drop-down list control to switch to edit mode. You can click the verbs menu (the down arrow) in the title bar of one of the controls, and click Edit to edit the selected control. When the EditorZone control and editing UI are visible, you can see the button that represents the apply verb, and click the Toggle ApplyVerb Enabled button to enable or disable it.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft