Rendering child controls of custom composite control inside a Repeater
<p>I have a custom control derived from the <code>CompositeControl</code> class, which is defined as:</p>

<pre class="lang-cs prettyprint-override"><code>[ToolboxData("&lt;{0}:ContractControl runat=server&gt;&lt;/{0}:ContractControl&gt;")]
public class ContractControl : CompositeControl
{
    private int contractID = 0;
    private ContractTileControl tileControl = null;
    private ContractDetailControl detailControl = null;

    private HtmlGenericControl contractMainDiv = null;

    public int ContractID
    {
        get { return this.contractID; }
        set { this.contractID = value; }
    }

    public ContractTileControl TileControl
    {
        get { return this.tileControl; }
        set { this.tileControl = value; }
    }

    public ContractDetailControl DetailControl
    {
        get { return this.detailControl; }
        set { this.detailControl = value; }
    }

    public ContractControl()
    {
        this.contractMainDiv = new HtmlGenericControl("div");
        this.contractMainDiv.ID = "contractMainDiv";
        this.contractMainDiv.Attributes.Add("class", "contractMain");
    }

    #region protected override void OnPreRender(EventArgs e)
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        CreateChildControls();
    }
    #endregion

    #region protected override void CreateChildControls()
    protected override void CreateChildControls()
    {
        if (tileControl != null)
        {
            this.contractMainDiv.Controls.Add(tileControl);
        }

        if (detailControl != null)
        {
            this.contractMainDiv.Controls.Add(detailControl);
        }

        this.Controls.Add(contractMainDiv);
    }

    #endregion

}
</code></pre>

<p>When I add a number of them to a placeholder control they render fine, but when I try to bind the same ones to a <code>Repeater</code>, the child composite controls <code>tileControl</code> and <code>detailControl</code> do not render, only the <code>contractMainDiv</code> does.</p>

<p>The repeater is defined as:</p>

<pre class="lang-cs prettyprint-override"><code>&lt;asp:Repeater ID="myRepeater" runat="server" EnableTheming="true"&gt;
  &lt;HeaderTemplate&gt;
    &lt;table border="0" cellpadding="0" cellspacing="0"&gt;
  &lt;/HeaderTemplate&gt;

  &lt;ItemTemplate&gt;
    &lt;tr&gt;&lt;td&gt;&lt;easit:ContractControl ID="contractControl" runat="server" /&gt;
    &lt;/td&gt;&lt;/tr&gt;
  &lt;/ItemTemplate&gt;

  &lt;FooterTemplate&gt;
    &lt;/table&gt;
  &lt;/FooterTemplate&gt;
&lt;/asp:Repeater&gt;
</code></pre>

<p>And I bind to it by first generating a <code>List&lt;ContractControl&gt;</code> and then calling:</p>

<pre class="lang-cs prettyprint-override"><code> List&lt;ContractControl&gt; controls = new List&lt;ContractControl&gt;();

 //Generate custom controls for each element in input dictionary

 //Create TileControl and DetailControl

 //Create ContractControl and add it to collection
 ContractControl contractControl = new ContractControl();
 contractControl.ContractID = contract.Contract.Id;
 contractControl.TileControl = tile;
 contractControl.DetailControl = detail;
 controls.Add(contractControl);

 myRepeater.DataSource = controls;
 myRepeater.DataBind();
</code></pre>

<p>Yet the resulting table contains the right number of items, but the child 'CompositeControl's do not get rendered at all, only the <code>contractMainDiv</code> shows up.</p>
