You can use following code in Page_Load method in asp.net
protected void Page_Load(object sender, EventArgs e)
{
Panel p1 = new Panel();
this.form1.Controls.Add(p1);
Label l1= new Label();// Just only to test the working of panel control
l1.Text=';Test Label in Panel';;
p1.Width = 200;
p1.Height = 200;
p1.BackColor = System.Drawing.Color.Red;
p1.BorderColor = System.Drawing.Color.Black;
p1.Controls.Add(l1);
p1.Visible = true;
p1.Enabled = true;
}How to create panel control dynamically in asp.net?
This is not a java code . This code is in C# (C sharp) and works on all releases i,e VS 2005, VS 2008.
I think you was use code in VB.Net or you are trying to write this code inline. To solve problem use code behid file. You can visit http://programingcsharp.blogsp鈥?/a> to get more details
Report Abuse
How to create panel control dynamically in asp.net?
y dont u ask this question to professionals. My friend is working in a web development firm 'HAYGREEV'. he will surely help u. send ur query through this website. http://www.haygreev.com
No comments:
Post a Comment