This documentation is archived and is not being maintained.

WebZone.EmptyZoneText Property

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

Gets or sets a message that appears when a zone contains no controls.

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

public virtual string EmptyZoneText { get; set; }
/** @property */
public String get_EmptyZoneText ()

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

public function get EmptyZoneText () : String

public function set EmptyZoneText (value : String)

Property Value

A string containing the message that appears in an empty zone. A default culture-specific string is supplied by the .NET Framework.

The text in the EmptyZoneText property appears when there are no controls in a zone, and the zone is in one of the personalization modes, such as edit, design, or catalog mode.


When a zone enters one of the personalization modes that would allow personalization changes to be made to the zone's contents, the WebPartManager control sets the WebPartDisplayMode.AllowPageDesign property value to true on the display mode object referenced in its WebPartManager.DisplayMode property.

The following code example demonstrates the use of the EmptyZoneText property. Note that there are two zones in the declarative markup, and the second <asp:webpartzone> element is empty.

<%@ page language="C#" %>
<%@ register TagPrefix="uc1" 
  Src="DisplayModeMenuCS.ascx" %>
<head id="Head1" runat="server">
  <form id="Form1" runat="server">
    <asp:webpartmanager id="WebPartManager1" runat="server" />
    <uc1:DisplayModeMenuCS ID="DisplayModeMenu1" runat="server" />
          <asp:Calendar ID="cal1" Runat="server" Title="My Calendar" />
      EmptyZoneText="No controls in this zone.">

In a browser, you can switch to design mode to see the text supplied for the EmptyZoneText property displayed in the empty zone. For details on how to change page display modes, see Walkthrough: Changing Display Modes on a Web Parts Page.

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