if (this.TextBox1.Text.Trim() != "")
{
int len = int.Parse(this.TextBox1.Text.Trim());
for (int i = 0; i < len; i++)
{
TableCell tc = new TableCell();
TableCell tc2 = new TableCell();
TextBox txt = new TextBox();
txt.ID = "txt" + i.ToString();
LiteralControl lc = new LiteralControl("<input id='Button2' type='button' value='button' onclick=javascript:fun('"+txt.ID+"') />");
tc.Controls.Add(txt);
tc2.Controls.Add(lc);
TableRow tr = new TableRow();
tr.Cells.Add(tc);
tr.Cells.Add(tc2);
this.Table1.Rows.Add(tr);
}
}
{
int len = int.Parse(this.TextBox1.Text.Trim());
for (int i = 0; i < len; i++)
{
TableCell tc = new TableCell();
TableCell tc2 = new TableCell();
TextBox txt = new TextBox();
txt.ID = "txt" + i.ToString();
LiteralControl lc = new LiteralControl("<input id='Button2' type='button' value='button' onclick=javascript:fun('"+txt.ID+"') />");
tc.Controls.Add(txt);
tc2.Controls.Add(lc);
TableRow tr = new TableRow();
tr.Cells.Add(tc);
tr.Cells.Add(tc2);
this.Table1.Rows.Add(tr);
}
}