WebPartZoneBase.BorderStyle Property

Definition

Gets or sets the kind of border that surrounds a WebPartZoneBase control.

public:
 virtual property System::Web::UI::WebControls::BorderStyle BorderStyle { System::Web::UI::WebControls::BorderStyle get(); void set(System::Web::UI::WebControls::BorderStyle value); };
public override System.Web.UI.WebControls.BorderStyle BorderStyle { get; set; }
member this.BorderStyle : System.Web.UI.WebControls.BorderStyle with get, set
Public Overrides Property BorderStyle As BorderStyle

Property Value

A BorderStyle object that contains the kind of border. The default is Solid.

Examples

The following code example demonstrates the declarative use of the BorderStyle 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 BorderStyle attribute is set to a specific kind of border. 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>
<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>

Remarks

The base BorderStyle property is overridden by the WebPartZoneBase class to set the default border style for zones.

You can set the BorderStyle 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.

Applies to

See also