Adding a custom control to a page, then adding multiple custom children into that one, null user con
- by Rickjaah
Hello all,
While nerding my way through the day again. I came across a problem concerning adding children to an already add child control.
I can add the controls, but when trying to use the controls in the added control, they all return null.
This is the method:
protected override CreateChildControls(EventArgs e)
{
UserControl uControl = LoadControl("~/controls/TwoColumn.ascx");
PlaceHolder holder = uControl.Controls.FindControl(phrContentMiddle) as PlaceHolder;
holder.Controls.Add(LoadControl("~/controls/ImageShowControl");
}
When i try to call any type of button/UserControl inside the ImageShowControl.... All return null. Is this something in the Page LifeCycle?
If so, what is the way to go to realize this?