Change your existing code for the Div property as following.
public ITemplate Div
{
get
{
return div;
}
set
{
div = value;
Controls.Clear();
div.InstantiateIn(containerDiv);
base.Controls.Add(containerDiv);
}
}
You have missed adding the container to the base class.
base.Controls.Add(containerDiv);
And your HTML within the Div will look like.
<cc1:ECBDiv ID="ECBDiv1" runat="server">
<Div>
<asp:button id="BtnTest" text="Test" runat="server" onclick="BtnTestClick" xmlns:asp="#unknown" />
</Div>
</cc1:ECBDiv>
And finally your event
protected void BtnTestClick(object sender, EventArgs e)
{
Response.Write("Test");
}