I must be missing a trick here. I have an .aspx page (that uses a master page, if that matters) with the following code in it:
<me:ModuleContainer runat="server" ID="topmodules"></me:ModuleContainer>
Now for some reason, my UserControl for ModuleContainer is called, all the properties on the control are called correctly, however it seems it just doesn’t fill the control with the children in the .ascx file. Whereever I try to access them in the code (tried on Load and PreRender), the values are always null.
But it works if I programatically add it with the LoadControl method (but not just by declaring a new instance of ModuleContainer.
Ideally I’d like to get it working when loaded in the page. What am I doing wrong?
Not even quater of an hour after asking the question, I worked it out.
Control wasn’t registered in the
web.configfile as the.ascxfile. I was trying to register the whole namespace using this markup.But it worked fine when I used this markup