---
title: "Panel Control in ASP.Net"  
description: "The Panel Web server control is used to contain other controls, say a set of radio buttons, check boxes, etc. This is a very useful control which allo"  
author: "Pushpendra Singh"  
published: 2010-10-27  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/180/panel-control-in-asp-dot-net  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 2 minutes  

---

# Panel Control in ASP.Net

The Panel Web server control is used to contain other controls, say a set of radio buttons, check boxes, etc. This is a very useful control which allows us to show or hide a group of controls at once.\

```
<asp:Panel ID="Panel1" runat="server"> </asp:Panel>
```

\

![Panel Control in ASP.Net](https://www.mindstick.com/mindstickarticle/fa39a423-e004-4707-89c1-75936fc17676/images/50b7275b-b3e1-4a1f-90a0-871738da1799.png)

## Properties

| Property | Description |
| --- | --- |
| BackImageUrl | Specifies a URL to an image file to display as a background for this control |
| Direction | Specifies the content display direction of the Panel |
| ScrollBars | Specifies the position and visibility of scroll bars in the Panel |

![Panel Control in ASP.Net](https://www.mindstick.com/mindstickarticle/fa39a423-e004-4707-89c1-75936fc17676/images/5027e9b5-773f-4605-92b3-ab7b09ae1e75.png)

We can change the appearance of panel; we can set the image in the background of panel

![Panel Control in ASP.Net](https://www.mindstick.com/mindstickarticle/fa39a423-e004-4707-89c1-75936fc17676/images/c50f669e-7277-462b-aa7f-a8866193c43e.png)

![Panel Control in ASP.Net](https://www.mindstick.com/mindstickarticle/fa39a423-e004-4707-89c1-75936fc17676/images/9ae72b8b-312d-4ea8-b4f2-9d0fcc3726d7.png)

## Example

Personal information is specified in Panel1 and contact information is specified in panel2.

Here two link buttons are used to show information of panel1 and panel2.

```
         <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Personal information</asp:LinkButton>        <asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">contact information</asp:LinkButton><asp:Panel ID="Panel1" runat="server" Font-Bold="True" Font-Underline="False"             ForeColor="Red" Height="202px" BackColor="#99FFCC" Width="267px">            <span class="style1">Personal Information<br />            Name&nbsp;&nbsp;&nbsp;&nbsp; </span>            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>            <br class="style1" />            <span class="style1">&nbsp;Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>            <br class="style1" />            <span class="style1">&nbsp;Country</span><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>            <br class="style1" />            <span class="style1"></span>            <asp:Button ID="Button1" runat="server" Text="Save" />            <br />        </asp:Panel><asp:Panel ID="Panel2" runat="server" Height="202px" BackColor="#66FF99"          Width="268px">         <b>&nbsp;contact Information<br />         <br />         &nbsp;mob. no </b>         <asp:TextBox ID="TextBox4" runat="server" CssClass="style2"></asp:TextBox>         <b>         <br />         email id&nbsp; </b>         <asp:TextBox ID="TextBox5" runat="server" CssClass="style2"></asp:TextBox>         <b>         <br />          </b>     <asp:Button ID="Button2" runat="server" CssClass="style2" Text="save" />         <br />    </asp:Panel>  protected void Page_Load(object sender, EventArgs e)    {         Panel1.Visible = false;         Panel2.Visible = false;    }     protected void LinkButton1_Click(object sender, EventArgs e)    {         Panel1.Visible = true;         Panel2.Visible = false;    }     protected void LinkButton2_Click(object sender, EventArgs e)    {         Panel1.Visible = false;         Panel2.Visible = true;    }
```

\

When you click personal information LinkButton then personal information panel will show.

![Panel Control in ASP.Net](https://www.mindstick.com/mindstickarticle/fa39a423-e004-4707-89c1-75936fc17676/images/2c1809aa-c179-465c-9a6d-3fccbf1f00a4.png)

When you click contact information link button then contact information panel will show.

![Panel Control in ASP.Net](https://www.mindstick.com/mindstickarticle/fa39a423-e004-4707-89c1-75936fc17676/images/a4d7fb3c-d384-4081-b92d-a9cfb288c9f6.png)

---

Original Source: https://www.mindstick.com/articles/180/panel-control-in-asp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
