I do not know how to add controls dynamically to the form using C# .net. Can anyone help me? I know this with vb.net but I need to know the syntax in C#.
Below is the code to add controls dynamically to ASP.NET form.
Label lbl1 = new Label();
lbl1.Text = "Your message here";
Panel panel1= new Panel();
panel1.Controls.Add(lbl1);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With