using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
public void MakeTable(object sender, EventArgs e)
{
HtmlTableRow rownp = new HtmlTableRow();
HtmlTableCell cellnp = new HtmlTableCell();
//THE DYNAMIC BUTTON IS HERE **************************************
Button bt = new Button();
bt.Text = "Click Me";
bt.Click += new EventHandler(bt_Click);
cellnp.Controls.Add(bt);
rownp.Controls.Add(cellnp);
TheTable.Rows.Add(rownp);
}
protected void Page_Load(object sender, EventArgs e)
{
}
void bt_Click(object sender, EventArgs e)
{
lbl1.Text = "Hello";
}
}