C# - The Panel Class

The Panel Web control renders a logical division to the browser enabling you to group elements of your interface together.

Properties of the Panel Class

Item Description
Properties
BackImageUrl Specifies an image to display in the background of the rendered panel
HorizontalAlign Aligns the rendered panel horizontally within its container
Wrap Specifies whether the content in the rendered panel should be wrapped
Panel.BackImageUrl

Syntax

String BackImageUrl

Description

The Panel.BackImageUrl property specifies an image to display in the background of the rendered panel.

Example

MyPanel.BackImageUrl = "/images/logo.jpg";
Panel.HorizontalAlign

Syntax

HorizontalAlign HorizontalAlign

Description

The Panel.HorizontalAlign property is used to align the rendered panel horizontally in its container. Valid values are Center, Justify, Left, NotSet and Right.

Example

MyPanel.HorizontalAlign = HorizontalAlign.Left;
Panel.Wrap

Syntax

Boolean Wrap

Description

The Panel.Wrap property specifies whether the content in the rendered panel should be wrapped.

Example

MyPanel.Wrap = true;