My code:
protected void Button1_Click(object sender, EventArgs e)
{
CustomControl myControl = new CustomControl();
UpdatePanel1.ContentTemplateContainer.Controls.Add(myControl);
Button btn = new Button();
UpdatePanel1.ContentTemplateContainer.Controls.Add(btn);
}
After click new button appears but my control did not. CustomControl if fine(?) since I can add it into .aspx file and it work without any problem.
What did I wrong?
btw. There is no errors or warnings, it just don't add custom control to html page.