Go to DotNetFunda.com
 Online : 869 |  Welcome, Guest!   Login
 
<<= Please see left side tutorials menu.


Silverlight Tutorials | Report a Bug in the Tutorial

Interesting?   Share and Bookmark this

asp:Panel control
Panel control is generally used to keep a set of controls into it.
 
Panel control is generally used to keep a set of controls into it. It is frequently used when you have to programmatically generate controls. When it is rendered on the page, generally it is implemented through <div> HTML tag.

Its properties like BackColor, ForeColor, BorderColor, BorderStyle, BorderWidth, Height etc. are implemented through style properites of <input> tag.

Following are some important properties that are very useful.
GroupingText Its used to set the caption of the group of controls inside the panel.
Visible true/false. Used to hide or show the panel.
DEMO : Panel Show Source Code

This contorl and outer HTML Table also added from Server side
 
// Panel Control /////////////////////////////////////////////
<asp:Panel ID="Panel1" runat="server" GroupingText="Panel Control Test"></asp:Panel>

// Code Behid Code /////////////////////////////////////////////
 private void PopulatePanel()
    {
        // Add ASP.NET Server Control
        TextBox txt1 = new TextBox();
        txt1.ID = "txt1";
        txt1.Width = 300;
        txt1.Text = "This control added from Server side.";
        Panel1.Controls.Add(txt1);

        // Add HTML controls
        string strHTML = "<hr /><table border='1'><tr><td>This contorl and outer HTML Table also added from Server side</td></tr><tr><td><input type='text' name='txtname' id='txtname' /></td></tr></table>";
        Panel1.Controls.Add(new LiteralControl(strHTML));
            
    }
                    




About Us | The Team | Advertise | Contact Us | Feedback | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found copied contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)