A
Andy Fish
Hi,
I have a web user control (i.e. one which I've made in the designer by just
dropping some other controls on). It works if I place it on a web form but
not if I try to add it dynamically. I'm just doing this:
MyControl ctl = new MyControl();
parentControl.Controls.Add(ctl);
when I call Add, the user control's page load event fires, but the child
controls are all set to null. Even if I call EnsureChildControls, they are
still null afterwards. How do I get the child controls of my user control
initialised?
TIA
Andy
I have a web user control (i.e. one which I've made in the designer by just
dropping some other controls on). It works if I place it on a web form but
not if I try to add it dynamically. I'm just doing this:
MyControl ctl = new MyControl();
parentControl.Controls.Add(ctl);
when I call Add, the user control's page load event fires, but the child
controls are all set to null. Even if I call EnsureChildControls, they are
still null afterwards. How do I get the child controls of my user control
initialised?
TIA
Andy