using System;
using System.Data;
using System.Configuration;
using System.Collections;
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;
using Telerik.Web.UI;

public partial class DynamicContainer : System.Web.UI.UserControl
{
	protected void Page_Init(object sender, EventArgs e)
	{

		Table MyTable = new Table();
		TableRow MyRow = new TableRow();
		TableCell ButtonCell = new TableCell();
		TableCell MyCell = new TableCell();

		UserControl MyControl = (UserControl)Page.LoadControl("WebUserControl.ascx");
		UserControl MyButton = (UserControl)Page.LoadControl("Button.ascx");

		MyControl.ID = "WebUserControl1";
		MyButton.ID = "MyButton1";
		//MyTable.ID = "MyTable";
		//MyRow.ID = "MyRow";
		//ButtonCell.ID = "MyButtonCell";
		//MyCell.ID = "MyCell";

		//ButtonCell.Controls.Add(MyButton);
		//MyCell.Controls.Add(MyControl);
		//MyRow.Cells.Add(MyCell);
		//MyRow.Cells.Add(ButtonCell);
		//MyTable.Rows.Add(MyRow);
		MyPanel1.Controls.Add(MyControl);
		MyPanel1.Controls.Add(MyButton);
		System.Web.UI.WebControls.Button btn = (System.Web.UI.WebControls.Button)MyPanel1.FindControl("MyButton1").FindControl("btnOk");
		
		AjaxSetting setting = new AjaxSetting(btn.ID);
		AjaxUpdatedControl updated = new AjaxUpdatedControl();

		updated.ControlID = MyControl.ID;
		setting.UpdatedControls.Add(updated);
		RadAjaxManager1.AjaxSettings.Add(setting);

	}

}
