WebPartZoneBase.EditVerb 屬性

定義

取得 WebPartVerb 物件的參考,這個物件可讓使用者編輯區域中的 WebPart 控制項。

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

屬性值

WebPartVerb,可讓使用者編輯 WebPart 控制項。

屬性

範例

下列程式碼範例示範 控制項上 WebPartZone 屬性的 EditVerb 宣告式用法。 請注意,屬性是以宣告方式存取,方法是搭配 控制項使用 <EditVerb> 專案 WebPartZone1 。 編輯動詞會在編輯模式中出現在此控制項上,即使您未在此使用 <EditVerb> 元素,但使用它,您可以設定一些屬性,例如代表使用者介面中動詞的文字, (UI) 。 如需完整的程式碼範例,包括程式碼後置原始程式檔和包含此程式碼中區域的 .aspx 頁面,請參閱 WebPartZoneBase 類別概觀。

<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 為編輯模式,讓使用者可以個人化控制項的外觀、屬性、版面配置和內容。

相同的編輯動詞用於區域中的所有控制項。 當網頁元件頁面進入編輯顯示模式 (EditDisplayMode) 時,編輯動詞會在區域所包含的每個 WebPart 控制項的動詞功能表中顯示。

適用於

另請參閱