Export (0) Print
Expand All

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)

[LocalizableAttribute(true)] 
public virtual string SelectTargetZoneText { get; set; }
/** @property */
public String get_SelectTargetZoneText ()

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

public function get SelectTargetZoneText () : String

public function set SelectTargetZoneText (value : String)

Not applicable.

Property Value

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

Windows 98, Windows Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft