Adding Controls Dynamically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
I am working in C#
I have created one usercontrol.
Now added a panel to this control. In a panel i have added another control.

Now, i have added this usercontrol to a form.
Now, on button click in this usercontrol i have to dynamically add the
control to the same panel (panel already containing one control, the new
control should be added below this control.)

How this can be done.
Thanks,
Carol
 
1. Use FindControl API and Find the Panel.
2. Once You find Panel Conrol use Controls.Add() method to add dynamically
created control
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top