Bagikan melalui


WebPartZoneBase.MenuLabelText Properti

Definisi

Mendapatkan atau mengatur nilai yang berfungsi sebagai label untuk menu drop-down kata kerja di bilah judul setiap WebPart kontrol di zona.

public:
 virtual property System::String ^ MenuLabelText { System::String ^ get(); void set(System::String ^ value); };
public virtual string MenuLabelText { get; set; }
member this.MenuLabelText : string with get, set
Public Overridable Property MenuLabelText As String

Nilai Properti

String yang berisi teks yang muncul di label untuk menu kata kerja. Defaultnya adalah string kosong ("").

Contoh

Contoh kode berikut menunjukkan penggunaan MenuLabelText deklaratif properti pada WebPartZone kontrol. Untuk contoh kode lengkap, termasuk file sumber code-behind dan halaman .aspx yang berisi zona dalam kode ini, lihat WebPartZoneBase gambaran umum kelas.

Perhatikan bahwa MenuLabelText properti memiliki nilai yang ditetapkan untuknya dalam markup deklaratif. Nilai ini berdampak WebPartZone2. Setelah Anda memuat halaman ke browser, alihkan halaman ke mode edit, dan perhatikan bahwa teks untuk label menu kata kerja adalah WebPartZone2 nilai yang ditetapkan untuk halaman tersebut dalam markup deklaratif.

<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>

Keterangan

MenuLabelText Jika properti diberi nilai, label muncul bersama gambar yang mewakili menu drop-down kata kerja di bilah judul setiap WebPart kontrol di zona. Jika tidak ada nilai yang ditetapkan ke properti , hanya gambar yang muncul di menu.

Nilai properti ini, ketika diatur, dapat disimpan secara otomatis ke file sumber daya dengan menggunakan alat perancang. Untuk informasi selengkapnya, lihat LocalizableAttribute dan Globalisasi dan Pelokalan.

Berlaku untuk

Lihat juga