PageCatalogPart.Title 属性

定义

获取或设置在控件标题栏中显示的标题。

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

属性值

用作控件标题的字符串。 默认值是 Web 部件控件集提供的、计算出的控件名称。

示例

下面的代码示例演示 了 属性的 Title 声明性用法。 有关运行示例所需的完整代码,请参阅类概述的 PageCatalogPart “示例”部分。

以下源代码演示如何在声明性标记中的 控件上设置 Title 属性。 如果未设置 属性,或者分配空字符串 (“”) ,则会提供默认标题。

<asp:CatalogZone ID="CatalogZone1" runat="server">
  <ZoneTemplate>
    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" 
      Title="My Page Catalog" 
      ChromeType="Titleonly" />
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1"  
      runat="server" 
      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:PageCatalogPart ID="PageCatalogPart1" runat="server" 
      Title="My Page Catalog" 
      ChromeType="TitleOnly" />
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1"  
      runat="server" 
      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 控件在目录模式下可见时,属性值将显示在控件的 PageCatalogPart 标题栏中。 在页中声明控件时,可以使用 特性设置 属性 Title 的值。 如果不为游戏提供值,则使用特定于区域性的默认值来描述此控件允许用户编辑的属性类型。

适用于

另请参阅