asp.net auto generated textboxes ID on webform
<p>I am using <strong>C#</strong> on <strong>Visual Studio</strong>. I want to generate a <strong>webform</strong> with auto numbered <code>Textboxes</code> depending on the input from the previous page. What is the best way to do this loop?</p>

<p>For example:</p>

<p>Input is 4</p>

<p>The next page should generate textboxes with ID of </p>

<ul>
<li>"name1"</li>
<li>"name2"  </li>
<li>"name3"</li>
<li>"name4"</li>
</ul>

<p>Something like this :</p>

<pre><code>&lt;asp:TextBox ID="name1" runat="server"&gt;&lt;/asp:TextBox&gt;
&lt;asp:TextBox ID="name2" runat="server"&gt;&lt;/asp:TextBox&gt;
&lt;asp:TextBox ID="name3" runat="server"&gt;&lt;/asp:TextBox&gt;
&lt;asp:TextBox ID="name4" runat="server"&gt;&lt;/asp:TextBox&gt;
</code></pre>

<p>Part 2 of my question is that if I want to call them when a <code>Button</code> is click, how should I use a loop the get those ID?</p>
