Hi ,
Try this will Guide you .
int countTimes = 0;
protected void Button1_Click(object sender, EventArgs e)
{
if (ViewState["countTimes"] == null)
{
countTimes = 1;
}
else
{
countTimes = Convert.ToInt32(ViewState["countTimes"]);
}
for (int i = 0; i < countTimes; i++)
{
TableRow tr = new TableRow();
TableCell cl = new TableCell();
TableCell cl2 = new TableCell();
RadioButton raid = new RadioButton();
raid.ID = "raid" + i;
TextBox txt = new TextBox();
txt.ID = "txt"+i;
cl.Controls.Add(txt);
cl2.Controls.Add(raid);
tr.Controls.Add(cl);
tr.Controls.Add(cl2);
Table1.Controls.Add(tr);
}
countTimes = countTimes + 1;
ViewState.Add("countTimes", countTimes);
}
<div>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<asp:Table ID="Table1" runat="server">
</asp:Table>
</div>
Best Regards
M.Mitwalli