I have a UserControl which uses a UserControl, among other controls.
In the ascx
file I have the following code:
<%@ Register TagPrefix=
I had this problem when I was adding a user control in the code behind the wrong way. You have to use the Page.LoadControl method to initialize the control you can't just use new.
//WRONG
UserControls.BingoCardPage bcp = new UserControls.BingoCardPage();
form1.Controls.Add(bcp);
//RIGHT
UserControls.BingoCardPage bcp = (UserControls.BingoCardPage)Page.LoadControl("~/UserControls/BingoCardPage.ascx");
form1.Controls.Add(bcp);