G
Guest
Hi,
I have a User Control that I want to display at the top and bottom of the
web form. I have two PlaceHolders controls at the top and bottom of the page
and I'm loading the control programmatically in the placeholder control:
Control ctl = LoadControl("MyControl.ascx");
plhTop.Controls.Add(ctl);
plhBottom.Controls.Add(ctl);
The problem is that only plhBottom is displayed. If I change places of
plhTop and plhBottom in the code:
Control ctl = LoadControl("MyControl.ascx");
plhBottom.Controls.Add(ctl);
plhTop.Controls.Add(ctl);
then only plhTop is displayed.
Why doesn't this code display both controls?
Thank you.
I have a User Control that I want to display at the top and bottom of the
web form. I have two PlaceHolders controls at the top and bottom of the page
and I'm loading the control programmatically in the placeholder control:
Control ctl = LoadControl("MyControl.ascx");
plhTop.Controls.Add(ctl);
plhBottom.Controls.Add(ctl);
The problem is that only plhBottom is displayed. If I change places of
plhTop and plhBottom in the code:
Control ctl = LoadControl("MyControl.ascx");
plhBottom.Controls.Add(ctl);
plhTop.Controls.Add(ctl);
then only plhTop is displayed.
Why doesn't this code display both controls?
Thank you.