protected void Button2_Click1(object sender, EventArgs e) { for (int i = 1; i <= int.Parse(TextBox1.Text); i++) { TableRow tr = new TableRow(); for (int j = 1; j <= int.Parse(TextBox2.Text); j++) { TableCell tc = new TableCell(); Label lbl= new Label(); Button btn = new Button(); btn.Text = (i*j).ToString(); btn.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(btn, Click")); if (Request["__EVENTARGUMENT"] == "Click") { lbl.Text = (i * j).ToString(); } tc.Controls.Add(lbl); tc.Controls.Add(btn); tr.Controls.Add(tc); } Table1.Controls.Add(tr); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)