I didn't know it at the time I wrote this question, but this is actually a part of the natural life cycle of a custom control.
CreateChildControls()
is called each time EnsureChildControls()
is called. The trick is to set the ChildControlsCreated
property at the end of the first call to CreateChildControls()
, so the entire process does not happen more than once.