What causes markup-controls to be null?
- by Earlz
Ok, I have a very strange problem. I have a regular UserControl with some controls in the markup. At Page_Load these controls are still null. And I have tried EnsureChildControls
It is laid out like this:
Masterpage - Page - mycontrol1 - mycontrol2 - problemcontrol
ProblemControl is where the controls are null. MyControl1 contains MyControl2. MyControl2 is another UserControl which contains ProblemControl in it's markup. Masterpage is nothing special and Page contains MyControl1 in it's markup. The only oddity is that ProblemControl is created dynamically at Page_Init.
Everything works fine until I get to ProblemControl where none of the controls are being created. ProblemControl has the proper things all set such as the Page and Parent property. I do not see any problems. The source code for all of these(except ProblemControl) is pretty extensive, so I'm hoping someone can just give me some troubleshooting tips for this problem and if anyone has encountered it before.
Also, I can place ProblemControl on another Page control and it will work fine, it's something about mycontrol1 and/or mycontrol2. But we've never had any problems with mycontrol1 and mycontrol2 doesn't have anything I can see wrong with it. (which I've been tediously analyzing for the past few hours).
Has anyone else had this same problem? Are there any common things to check for?