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
 
Back
Top