This documentation is archived and is not being maintained.

WebPartZoneBase.BorderColor Property

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

Gets or sets the color for the border of a WebPartZoneBase control.

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

public override Color BorderColor { get; set; }
/** @property */
public Color get_BorderColor ()

/** @property */
public void set_BorderColor (Color value)

public override function get BorderColor () : Color

public override function set BorderColor (value : Color)

Property Value

A Color that contains the border color. The default color is Gray.

The base BorderColor property is overridden by the WebPartZoneBase class to set a default color for zone borders.

You can set the BorderColor property for a WebPartZoneBase control either declaratively or programmatically. The border appears only when the zone is in a page display mode in which WebPartZoneBase class user interface (UI) features are visible, such as EditDisplayMode or DesignDisplayMode.

The following code example demonstrates the declarative use of the BorderColor property on a WebPartZone control. For the full code example, including the code-behind source file and the .aspx page that contains the zone in this code, see the WebPartZoneBase class overview.

Notice that the BorderColor attribute is set to a specific named color. After you load the page into a browser and switch the page into design display mode, you can see the effect of the property.

<asp:WebPartZone 
  ID="WebPartZone2"
  Runat="server" 
  DragHighlightColor="#00ff00"
  AllowLayoutChange="true"
  EmptyZoneText="Add WebParts to this empty Zone."
  BorderWidth="2"
  BorderColor="DarkBlue"
  BorderStyle="Dashed" 
  MenuLabelText="Verbs Menu" 
  MenuPopupImageUrl="label.gif" >
  <VerbStyle Font-Italic="true" />
  <MenuLabelStyle BackColor="Lime" BorderWidth="1"  />
  <MenuLabelHoverStyle Font-Bold="true" />
  <MenuVerbHoverStyle BackColor="LightGrey" />
  <MenuVerbStyle Font-Italic="true" /> 
  <ZoneTemplate>
    <asp:Label ID="Label1" Runat="server" Title="Date" />
  </ZoneTemplate>
</asp:WebPartZone>

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
Show: