ChildControl of a childcontrol is null when calling from Main control
- by Jan Schoenrock
Hello
I built a webusercontrol in asp.net which contains a databound dropdown.
When I directly put this control into a webform it runs well.
But if I try to add this control as childcontrol to another control at runtime
Childcontrol childcontrol = new Childcontrol ();
maincontrol.controls.add(childcontrol)
, the dropdown of the childcontrol is not instatiated (is null) so that I run in an exception by trying to bind the data to the dropdown.