I
Iain
In my custom control I have overriden CreateChildControls and the first few
lines look like this.
protected override void CreateChildControls()
{
Debug.WriteLine("CreateChildControls", "FeatureList");
Controls.Clear();
..
}
what I am seeing is that the Controls.Clear line indirectly calls
CreateChildControls (the call seems to be through an internal get on the
Controls collection judging from the stack).
MyUI.DLL!MyUI.FeatureList.CreateChildControls() Line 570 C#
System.Web.dll!System.Web.UI.Control.EnsureChildControls() + 0x87 bytes
System.Web.dll!System.Web.UI.WebControls.CompositeControl.Controls.get() +
0x1c bytes
MyUI.DLL!MyUI.FeatureList.CreateChildControls() Line 571 + 0xb bytes C#
Although the controls end up being right, they are created twice which is
hardly efficient. What do I need to do to stop this happening?
Iain
lines look like this.
protected override void CreateChildControls()
{
Debug.WriteLine("CreateChildControls", "FeatureList");
Controls.Clear();
..
}
what I am seeing is that the Controls.Clear line indirectly calls
CreateChildControls (the call seems to be through an internal get on the
Controls collection judging from the stack).
MyUI.DLL!MyUI.FeatureList.CreateChildControls() Line 570 C#
System.Web.dll!System.Web.UI.Control.EnsureChildControls() + 0x87 bytes
System.Web.dll!System.Web.UI.WebControls.CompositeControl.Controls.get() +
0x1c bytes
MyUI.DLL!MyUI.FeatureList.CreateChildControls() Line 571 + 0xb bytes C#
Although the controls end up being right, they are created twice which is
hardly efficient. What do I need to do to stop this happening?
Iain