DeclarativeCatalogPart.Title 属性

定义

获取或设置在控件标题栏中显示的标题。Gets or sets the title that appears in the control's title bar.

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

属性值

String

用作控件标题的字符串。A string that is used as the title of the control. 默认值是 Web 部件控件集提供的、计算出的控件名称。The default value is a calculated control name supplied by the Web Parts control set.

示例

下面的代码示例演示了属性的声明性用法 TitleThe following code example demonstrates the declarative use of the Title property. 有关运行此示例所需的完整代码,请参阅类概述的 "示例" 部分 DeclarativeCatalogPartFor the full code required to run the example, see the Example section of the DeclarativeCatalogPart class overview.

此示例演示如何 Title 在声明性标记中设置控件的属性。This example shows how to set the Title property on the control in declarative markup. 如果未设置属性,或指定了空字符串 ( "" ) ,则将提供默认标题。If you do not set the property, or if you assign an empty string ("") , a default title is supplied.

<asp:CatalogZone ID="CatalogZone1" runat="server">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1"  
      runat="server" 
      Title="Web Parts Catalog"
      ChromeType="TitleOnly" 
      Description="Contains a user control with Web Parts and 
        an ASP.NET Calendar control.">
      <WebPartsTemplate>
        <asp:Calendar ID="Calendar1" runat="server" 
          Title="My Calendar" 
          Description="ASP.NET Calendar control used as a personal calendar." />
        <aspSample:UserInfoWebPart 
          runat="server"   
          id="userinfo1" 
          title = "User Information WebPart"
          Description ="Contains custom, editable user information 
            for display on a page." />
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="TextDisplayWebPart1" 
          title = "Text Display WebPart" 
          Description="Contains a label that users can dynamically update." />
      </WebPartsTemplate>              
    </asp:DeclarativeCatalogPart>
  </ZoneTemplate>
</asp:CatalogZone>
<asp:CatalogZone ID="CatalogZone1" runat="server">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1"  
      runat="server" 
      Title="Web Parts Catalog"
      ChromeType="TitleOnly" 
      Description="Contains a user control with Web Parts and 
        an ASP.NET Calendar control.">
      <WebPartsTemplate>
        <asp:Calendar ID="Calendar1" runat="server" 
          Title="My Calendar" 
          Description="ASP.NET Calendar control used as a personal calendar." />
        <aspSample:UserInfoWebPart 
          runat="server"   
          id="userinfo1" 
          title = "User Information WebPart"
          Description ="Contains custom, editable user information 
            for display on a page." />
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="TextDisplayWebPart1" 
          title = "Text Display WebPart" 
          Description="Contains a label that users can dynamically update." />
      </WebPartsTemplate>              
    </asp:DeclarativeCatalogPart>
  </ZoneTemplate>
</asp:CatalogZone>

注解

Title DeclarativeCatalogPart 当控件在目录模式中可见时,属性值显示在控件的标题栏中。The Title property value is displayed in the title bar of a DeclarativeCatalogPart control when the control is visible in catalog mode. 在页面中声明控件时,可以使用属性设置属性的值 TitleWhen the control is declared in a page, you can set a value for the property by using the Title attribute. 如果未提供标题的值,则使用特定于区域性的默认值描述此控件允许用户编辑的属性类型。If you do not supply a value for the title, a culture-specific default value is used to describe the kind of properties that this control allows users to edit.

适用于

另请参阅