CatalogZoneBase.HeaderText プロパティ

定義

ゾーンのヘッダー領域のテキストを取得または設定します。

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

プロパティ値

ゾーンのヘッダー テキストを含む文字列。 カルチャ固有の既定の文字列は、.NET Framework によって提供されます。

次のコード例では、 プロパティを宣言的およびプログラム的に使用 HeaderText する方法を示します。 この例を実行するために必要な完全なコードについては、クラスの概要の「例」セクションを CatalogZoneBase 参照してください。

コード例では、2 つの <asp:catalogzone> 要素が宣言されていることに注意してください。 2 つ目のコントロールは宣言 CatalogPart しませんが、どちらも プロパティの値を HeaderText 宣言します。

<asp:CatalogZone ID="CatalogZone1" runat="server"
  EmptyZoneText="No controls are in the zone."
  HeaderText="My Web Parts Catalog"
  InstructionText="Add Web Parts controls to the zone."
  PartLinkStyle-Font-Italic="true"
  SelectedPartLinkStyle-Font-Bold="true"
  SelectTargetZoneText="Select zone"
  AddVerb-Text="Add Control"
  CloseVerb-Description="Close and return to browse mode." 
  SelectedCatalogPartID="Currently Selected CatalogPart ID.">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" 
      runat="server">
      <WebPartsTemplate>
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="textwebpart" 
          title = "Text Content WebPart" 
          ExportMode="All"/>  
        <asp:Calendar id="calendar1" runat="server" 
          Title="My Calendar" />               
      </WebPartsTemplate>
    </asp:DeclarativeCatalogPart> 
    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
    <asp:ImportCatalogPart ID="ImportCatalogPart1" runat="server" /> 
  </ZoneTemplate>
</asp:CatalogZone>
<hr />
<asp:CatalogZone ID="CatalogZone2" runat="server"
  BorderWidth="2"
  HeaderText="My Empty CatalogZone"
  EmptyZoneText="No controls are in the zone." />
<asp:CatalogZone ID="CatalogZone1" runat="server"
  EmptyZoneText="No controls are in the zone."
  HeaderText="My Web Parts Catalog"
  InstructionText="Add Web Parts controls to the zone."
  PartLinkStyle-Font-Italic="true"
  SelectedPartLinkStyle-Font-Bold="true"
  SelectTargetZoneText="Select zone"
  AddVerb-Text="Add Control"
  CloseVerb-Description="Close and return to browse mode." 
  SelectedCatalogPartID="Currently Selected CatalogPart ID.">
  <ZoneTemplate>
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" 
      runat="server">
      <WebPartsTemplate>
        <aspSample:TextDisplayWebPart 
          runat="server"   
          id="textwebpart" 
          title = "Text Content WebPart" 
          ExportMode="All"/>  
        <asp:Calendar id="calendar1" runat="server" 
          Title="My Calendar" />               
      </WebPartsTemplate>
    </asp:DeclarativeCatalogPart> 
    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
    <asp:ImportCatalogPart ID="ImportCatalogPart1" runat="server" /> 
  </ZoneTemplate>
</asp:CatalogZone>
<hr />
<asp:CatalogZone ID="CatalogZone2" runat="server"
  BorderWidth="2"
  HeaderText="My Empty CatalogZone"
  EmptyZoneText="No controls are in the zone." />

コード例の 2 番目の部分では、最初のゾーンの プロパティの HeaderText 値がプログラムによって別の値に割り当てられます。

protected void Button3_Click(object sender, EventArgs e)
{
  CatalogZone1.SelectTargetZoneText = "Add to zone";
  CatalogZone1.EmptyZoneText = "Zone is empty";
  CatalogZone1.HeaderText = "My Updated Header";
  CatalogZone1.InstructionText = "My Updated Instructions";
}
Protected Sub Button3_Click(ByVal sender As Object, _
  ByVal e As EventArgs)
  CatalogZone1.SelectTargetZoneText = "Add to zone"
  CatalogZone1.EmptyZoneText = "Zone is empty"
  CatalogZone1.HeaderText = "My Updated Header"
  CatalogZone1.InstructionText = "My Updated Instructions"
End Sub

ブラウザーでページを読み込むときに、ドロップダウン リストから [ カタログ ] を選択してカタログ表示モードに切り替えることができます。 カタログが表示されたら、各ゾーンのヘッダー領域に表示される各 HeaderText プロパティの値に注目してください。 [ Set Zone Text Properties]\(ゾーン テキストのプロパティの設定 \) ボタンをクリックすると、 HeaderText 上のゾーンのプロパティがコード内で割り当てられた値に設定されます。

注釈

プロパティの HeaderText 文字列値は、ゾーンの一番上にあるゾーンの CatalogZoneBase ヘッダー領域に表示されます。 ページが HeaderText カタログ モードになり、カタログ ユーザー インターフェイス (UI) が表示されると、 プロパティのテキストが表示されます。

適用対象

こちらもご覧ください