ASP.NET PanelControls
Web Server Controls
Definition and Usage
The Panel control is used as a container for other controls.
Tip:This control is often used to generate controls programmatically, or to show and hide groups of controls.
Note:This control renders as an HTML <div> element.
Properties
| Property | Description | .NET |
|---|---|---|
| BackImageUrl | Specifies the URL of an image file to be displayed as the background of the control. | 1.0 |
| DefaultButton | Specifies the ID of the default button in the Panel. | 2.0 |
| Direction | Specifies the direction in which the content of the Panel is displayed. | 2.0 |
| GroupingText | Specifies the caption for the group of controls in the Panel. | 2.0 |
| HorizontalAlign | Specifies the horizontal alignment of the content. | 1.0 |
| runat | Specifies that the control is a server control. Must be set to "server". | 1.0 |
| ScrollBars | Specifies the position and visibility of scroll bars in the Panel. | 2.0 |
| Wrap | Specifies whether the content wraps. | 1.0 |
Web Control Standard Properties
AccessKey, Attributes, BackColor, BorderColor,
BorderStyle, BorderWidth, CssClass, Enabled, Font, EnableTheming,
ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width
For a full description, please visitWeb Control Standard Properties。
Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer,
ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer,
Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID,
Visible
For a full description, please visitControl Standard Properties。
Example
Panel
In this example, we declare a Panel control, a CheckBox control, and a Button control in an .aspx file. When the user checks the CheckBox control and clicks the refresh button, the Panel control will be hidden.
Web Server Controls Other Extensions