WebPartZoneBase.MenuLabelText 属性

定义

获取或设置作为区域中每个 WebPart 控件的标题栏中的谓词下拉菜单的标签样式信息的值。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

属性值

包含出现在谓词菜单的标签中的文本的字符串。A string containing the text that appears in the label for the verbs menu. 默认值为空字符串("")。The default is an empty string ("").

示例

下面的代码示例演示了 WebPartZone 控件上 MenuLabelText 属性的声明性用法。The following code example demonstrates the declarative use of the MenuLabelText property on a WebPartZone control. 有关完整的代码示例,包括代码隐藏源文件和包含此代码中区域的 .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.

请注意,在声明性标记中,MenuLabelText 属性有一个分配给它的值。Notice that the MenuLabelText property has a value assigned to it in the declarative markup. 此值会影响 WebPartZone2This value impacts WebPartZone2. 将页面加载到浏览器中后,将页面切换到编辑模式,并注意 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>

注解

如果为 MenuLabelText 属性指定了一个值,则标签将显示在区域中每个 WebPart 控件的标题栏中表示谓词下拉菜单的图像旁边。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. 有关详细信息,请参阅 LocalizableAttribute全球化和本地化For more information, see LocalizableAttribute and Globalization and Localization.

适用于

另请参阅