How to use Panel control in asp.net

Panel example: how to use Panel control in asp.net
PanelControlExample.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Panel example: how to use Panel control in asp.net</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto" Width="450" Height="200" Wrap="true" BackColor="Aqua" Direction="LeftToRight">
                    <p>
                        You can use the Panel control as a container for other controls. This is particularly useful when you are creating content programmatically and you need a way to insert the content into the page. The following sections describe additional ways that you can use the Panel control. 

                        Container for Dynamically Generated Controls. 

                        Grouping Controls and Markup. 

                        The Panel control provides a convenient container for controls that you create at run time. For details, see Adding ASP.NET Controls Programmatically. 

                        You can manage a group of controls and associated markup as a unit by putting them in a Panel control and then manipulating the Panel control. For example, you can hide or show a group of controls inside a panel by setting the panel's Visible property. 
                    </p>
                </asp:Panel>
            </div>
        </form>
    </body>
</html>




Related asp.net example