日期:2014-05-17 浏览次数:20500 次
protected void Page_Load(object sender, EventArgs e)
{
Table tb = new Table();
tb.ID = "tb";
TableRow row = new TableRow();
TableCell cell = new TableCell();
Button btn = new Button();
btn.ID = "create";
btn.Text = "动态";
btn.Click += new EventHandler(btn_Click);
cell.Controls.Add(btn);
row.Cells.Add(cell);
tb.Rows.Add(row);
form1.Controls.Add(tb);
}
void btn_Click(object sender, EventArgs e)
{
Response.Write((sender as Button).Text);
}