HOW TO: Dynamically Create Controls in ASP.NET?
<p>I have created one asp.net website.. In that i have created 3 text boxes in row 1. on the click of the button i want a new row of textvoxes to be added each time. But with this piece of code i get it only once. can u advise on how to keep gettin new rows each time i click the button?</p>

<pre><code>    TextBox tb;
    for (int i = 1; (i &lt;= 1); i++)
    {
        tb = new TextBox();
        tb.Text = ("txttaskid" + (i + 1));
        tb.ID = ("txttaskid" + (i + 1));
        form1.Controls.Add(tb);
    }
    for (int j = 0; (j &lt;= 0); j++)
    {
        tb = new TextBox();
        tb.Text = ("txttaskdesc" + (j + 2));
        tb.ID = ("txttaskdesc" + (j + 2));
        form1.Controls.Add(tb);
    }
    for (int k = 0; (k &lt;= 0); k++)
    {
        tb = new TextBox();
        tb.Text = ("txtremarks" + (k + 2));
        tb.ID = ("txtremarks" + (k + 2));
        form1.Controls.Add(tb);
    }
</code></pre>

<p>Regards,
Raji.</p>
