Export (0) Print
Expand All

CatalogZoneBase.InstructionText Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the text in a zone that provides directions for end users.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

public override string InstructionText { get; set; }
/** @property */
public String get_InstructionText ()

/** @property */
public void set_InstructionText (String value)

public override function get InstructionText () : String

public override function set InstructionText (value : String)

Property Value

A string that contains the directions for end users. A default, culture-specific string is provided by the Web Parts control set.

The string value of the InstructionText property is displayed just below the header area of a CatalogZoneBase zone. The text of the InstructionText property is displayed when a page enters catalog mode and the catalog user interface (UI) becomes visible.

The purpose of the InstructionText property is to provide the user with general instructions on what to do when the catalog UI is displayed.

The following code example demonstrates how to use the InstructionText property declaratively and programmatically. For the full code required to run the example, see the Example section of the CatalogZoneBase class overview.

Notice that the code example declares two <asp:catalogzone> elements, and the first one declares a value for the InstructionText property.

<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." />

In the second part of the code example, the value of the InstructionText property in the first zone is programmatically assigned to a different value.

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";
}

When you load the page in a browser, you can select Catalog from the drop-down list to switch to catalog display mode. When the catalog is visible, notice the value of the InstructionText property displayed in the header area of each zone. You can click the Set Zone Text Properties button, and the InstructionText property of the upper zone is set to the value assigned to it in the code.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft