ASP.NET Panel Control
Web Server Controls
Definition and Usage
The Panel control serves as a container for other controls.
**Tip:** This control is commonly used to generate controls programmatically, or to show and hide groups of controls.
**Note:** This control is rendered as HTML
property
| property | Description | .NET |
|---|---|---|
| BackImageUrl | Specifies the URL of the image file that displays the control's background. | 1.0 |
| DefaultButton | Specifies the ID of the default button in the Panel. | 2.0 |
| Direction | Specifies the content display direction of the Panel. | 2.0 |
| GroupingText | Specifies the caption of 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 scrollbars 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 complete description, please visit Web Control Standard Properties。
Control Standard Properties
AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible
For a complete description, please visit Web Control Standard Properties。
Example
Panel
In this example, we declare a Panel control, a CheckBox control, and a Button control in the .aspx file. When the user selects the CheckBox control and clicks the refresh button, the Panel control is hidden.
Web Server Controls