WebPartZoneBase.MenuLabelText 属性

定义

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

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

属性值

String

包含出现在谓词菜单的标签中的文本的字符串。 默认值为空字符串("")。

示例

下面的代码示例演示了控件上WebPartZone属性的MenuLabelText声明性用法。 有关完整代码示例(包括代码隐藏源文件和包含此代码中的区域的 .aspx 页)请参阅 WebPartZoneBase 类概述。

请注意,该 MenuLabelText 属性在声明性标记中为其分配了一个值。 此值会影响 WebPartZone2。 将页面加载到浏览器中后,将页面切换到编辑模式,并注意到谓词菜单标签 WebPartZone2 的文本是声明性标记中分配给它的值。

<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 谓词下拉菜单。 如果未向属性分配任何值,则只显示菜单上的图像。

设置时,此属性的值可以使用设计器工具自动保存到资源文件中。 有关详细信息,请参阅LocalizableAttribute全球化和本地化

适用于

另请参阅