WebPartZoneBase.EditVerb 属性

定义

获取对 WebPartVerb 对象的引用,该对象使最终用户能够编辑区域中的 WebPart 控件。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; }
member this.EditVerb : System.Web.UI.WebControls.WebParts.WebPartVerb
Public Overridable ReadOnly Property EditVerb As WebPartVerb

属性值

使最终用户能够编辑 WebPartVerb 控件的 WebPartA WebPartVerb that enables end users to edit WebPart controls.

属性

示例

下面的代码示例演示了 WebPartZone 控件上 EditVerb 属性的声明性用法。The following code example demonstrates the declarative use of the EditVerb property on a WebPartZone control. 请注意,通过将 <EditVerb> 元素与 WebPartZone1 控件结合使用来以声明方式访问属性。Note that the property is accessed declaratively by using the <EditVerb> element with the WebPartZone1 control. 即使你未在此处使用 <EditVerb> 元素,也可以在编辑模式下在此控件上显示编辑谓词,但你可以在用户界面(UI)中设置它的一些属性,例如表示谓词的文本。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). 有关完整的代码示例,包括代码隐藏源文件和包含此代码中区域的 .aspx 页面,请参阅 WebPartZoneBase 类概述。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>

注解

通过 WebPartZoneBase 控件上的 EditVerb 属性引用的编辑谓词,最终用户可以将区域中的 WebPart 控件切换到编辑模式,在该模式中,用户可以个性化控件的外观、属性、布局和内容。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. 当 Web 部件页面进入编辑显示模式(EditDisplayMode)时,编辑谓词将在区域中包含的每个 WebPart 控件的谓词菜单中变为可见。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.

适用于

另请参阅