Edit

Share via


WebPartZoneBase.EditVerb Property

Definition

Gets a reference to a WebPartVerb object that enables end users to edit WebPart controls in a zone.

public:
 virtual property System::Web::UI::WebControls::WebParts::WebPartVerb ^ EditVerb { System::Web::UI::WebControls::WebParts::WebPartVerb ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public virtual System.Web.UI.WebControls.WebParts.WebPartVerb EditVerb { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.EditVerb : System.Web.UI.WebControls.WebParts.WebPartVerb
Public Overridable ReadOnly Property EditVerb As WebPartVerb

Property Value

A WebPartVerb that enables end users to edit WebPart controls.

Attributes

Examples

The following code example demonstrates the declarative use of the EditVerb property on a WebPartZone control. Note that the property is accessed declaratively by using the <EditVerb> element with the WebPartZone1 control. An edit verb would be present on this control in edit mode even if you did not use the <EditVerb> element here, but by using it, you can set some of its attributes, such as the text that represents the verb in the user interface (UI). For the full code example, including the code-behind source file and the .aspx page that contains the zone in this code, see the WebPartZoneBase class overview.

<asp:WebPartZone 
  ID="WebPartZone1" 
  Runat="server"
  LayoutOrientation="Vertical" >
  <EditVerb Text="Edit WebPart" />
  <SelectedPartChromeStyle BackColor="LightBlue" />
  <ZoneTemplate>
    <asp:BulletedList 
      ID="BulletedList1" 
      Runat="server"
      DisplayMode="HyperLink" 
      Title="Favorite Links" >
      <asp:ListItem Value="http://msdn.microsoft.com">
        MSDN
      </asp:ListItem>
      <asp:ListItem Value="http://www.asp.net">
        ASP.NET
      </asp:ListItem>
      <asp:ListItem Value="http://www.msn.com">
        MSN
      </asp:ListItem>
    </asp:BulletedList>
    <asp:Calendar ID="Calendar1" Runat="server" 
      Title="My Calendar" />
  </ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone 
  ID="WebPartZone1" 
  Runat="server"
  LayoutOrientation="Vertical" >
  <EditVerb Text="Edit WebPart" />
  <SelectedPartChromeStyle BackColor="LightBlue" />
  <ZoneTemplate>
    <asp:BulletedList 
      ID="BulletedList1" 
      Runat="server"
      DisplayMode="HyperLink" 
      Title="Favorite Links" >
      <asp:ListItem Value="http://msdn.microsoft.com">
        MSDN
      </asp:ListItem>
      <asp:ListItem Value="http://www.asp.net">
        ASP.NET
      </asp:ListItem>
      <asp:ListItem Value="http://www.msn.com">
        MSN
      </asp:ListItem>
    </asp:BulletedList>
    <asp:Calendar ID="Calendar1" Runat="server" 
      Title="My Calendar" />
  </ZoneTemplate>
</asp:WebPartZone>

Remarks

The edit verb referenced by the EditVerb property on a WebPartZoneBase control enables an end user to switch a WebPart control in the zone into edit mode, where the user can personalize the appearance, properties, layout, and content of the control.

The same edit verb is used for all controls in a zone. When a Web Parts page enters into the edit display mode (EditDisplayMode), the edit verb becomes visible in the verbs menu of each WebPart control contained in the zone.

Applies to

See also