This documentation is archived and is not being maintained.

CatalogZoneBase.SelectTargetZoneText Property

Gets or sets the text alongside the control in the catalog user interface (UI) that allows users to choose which zone to add their selected controls to.

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

public virtual string SelectTargetZoneText { get; set; }
<asp:CatalogZoneBase SelectTargetZoneText="String" />

Property Value

Type: System.String
A string that contains the text to display alongside the zone selection control. A default culture-specific string is supplied by the .NET Framework.

When the catalog UI first appears, users can select one of the CatalogPart controls, such as DeclarativeCatalogPart, that contains WebPart or other server controls that can be added to the Web page. The user selects one or more controls, and can then use the DropDownList control in the footer area of the catalog and choose the WebPartZone control on the page in which to place the selected server controls. The text value of the SelectTargetZoneText property is displayed alongside the DropDownList control as a simple instruction.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

The following code example demonstrates how to use the SelectTargetZoneText 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 first part of the code example declares two <asp:catalogzone> elements, and the first one declares a value for the SelectTargetZoneText 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."
  SelectTargetZoneText="Select zone"
  AddVerb-Text="Add Control"
  CloseVerb-Description="Close and return to browse mode." 
  SelectedCatalogPartID="Currently Selected CatalogPart ID.">
    <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" 
          title = "Text Content WebPart" 
        <asp:Calendar id="calendar1" runat="server" 
          Title="My Calendar" />               
    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
    <asp:ImportCatalogPart ID="ImportCatalogPart1" runat="server" /> 
<hr />
<asp:CatalogZone ID="CatalogZone2" runat="server"
  HeaderText="My Empty CatalogZone"
  EmptyZoneText="No controls are in the zone." />

In the second part of the code example, the value of the SelectTargetZoneText property is changed programmatically.

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, note the text displayed alongside the DropDownList control in the footer of the catalog. You can click the Set Zone Text Properties button to change the text value of the property.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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