using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Init(object sender, EventArgs e)
    {
        UserControl MyControl = (UserControl)Page.LoadControl("DynamicContainer.ascx");
        MyControl.ID = "Container1";

        Panel1.Controls.Add(MyControl);

    }

    protected void Page_Load(object sender, EventArgs e)
    {
        UserControl MyControl = (UserControl)Page.FindControl("Container1");

        if (MyControl != null)
            MyControl.Visible = true;

    }
}
