CatalogZoneBase.InstructionText プロパティ

定義

ゾーン内に表示される、エンド ユーザーに指示を与えるテキストを取得または設定します。

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

プロパティ値

String

エンドユーザーの指示を格納する文字列。 既定のカルチャ固有の文字列は、Web パーツ コントロール セットによって提供されます。

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

コード例では 2 つの <asp:catalogzone> 要素が宣言され、最初の要素はプロパティの値を InstructionText 宣言していることに注意してください。

<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 番目の部分では、最初のゾーンのプロパティの InstructionText 値がプログラムによって別の値に割り当てられます。

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

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

注釈

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

このプロパティの InstructionText 目的は、カタログ UI が表示されたときに実行する操作に関する一般的な手順をユーザーに提供することです。

適用対象

こちらもご覧ください