Hello everyone
I want to create Textboxes according to the entered number at runtime but with different names because I want to deal with the the data entered in this textboxes
protected void Button1_Click(object sender, EventArgs e)
{
int rows = 0;
int cells = 0;
int counter =int.Parse(TextBox1.Text);
for (int i = 0; i <= counter; i++)
{
HtmlTableRow ro = new HtmlTableRow();
HtmlTableCell ce1 = new HtmlTableCell();
HtmlTableCell ce2 = new HtmlTableCell();
ro.Cells.Add(ce1);
ro.Cells.Add(ce2);
table1.Rows.Add(ro);
if (cells > 1)
{
cells = 0;
rows++;
}
cells++;
TextBox tb =new TextBox();
this.table1.Rows[rows].Cells[cells].Controls.Add(tb);
cells++;
}
}
As previus I created this textboxes but with the same name so I cant deal with the data inserted in it
I want your help Please
Thank you