Επεξεργασία

Κοινή χρήση μέσω


WebPartZoneBase.MenuLabelText Property

Definition

Gets or sets the value that serves as a label for the verbs drop-down menu in the title bar of each WebPart control in a zone.

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

Property Value

A string containing the text that appears in the label for the verbs menu. The default is an empty string ("").

Examples

The following code example demonstrates the declarative use of the MenuLabelText property on a WebPartZone control. 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.

Notice that the MenuLabelText property has a value assigned to it in the declarative markup. This value impacts WebPartZone2. After you load the page into a browser, switch the page into edit mode, and notice that the text for the verbs menu label in WebPartZone2 is the value assigned to it in the declarative markup.

<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>

Remarks

If the MenuLabelText property is assigned a value, the label appears alongside an image that represents the verbs drop-down menu in the title bar of each WebPart control in a zone. If no value is assigned to the property, only the image appears on the menu.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and Globalization and Localization.

Applies to

See also