ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.How to generate dynamic TextBoxes based on count selected in DropDownList in ASP.Net<p>You can use Repeater for this.</p> <p><span style="text-decoration: underline;">HTML</span></p> <pre class="brush: html">&lt;div&gt; Numbers of TextBox &lt;asp:DropDownList ID=&#34;ddlNumberOfRows&#34; runat=&#34;server&#34; AutoPostBack=&#34;true&#34; OnSelectedIndexChanged=&#34;ddlNumberOfRows_SelectedIndexChanged&#34;&gt; &lt;asp:ListItem Text=&#34;One&#34; Value=&#34;1&#34; /&gt; &lt;asp:ListItem Text=&#34;Two&#34; Value=&#34;2&#34; /&gt; &lt;asp:ListItem Text=&#34;Three&#34; Value=&#34;3&#34; /&gt; &lt;/asp:DropDownList&gt; &lt;br /&gt; &lt;br /&gt; &lt;asp:Repeater ID=&#34;Repeater1&#34; runat=&#34;server&#34;&gt; &lt;ItemTemplate&gt; &lt;%#Container.ItemIndex+1 %&gt; &lt;asp:TextBox ID=&#34;txtTextBox1&#34; runat=&#34;server&#34; /&gt; &lt;/ItemTemplate&gt; &lt;SeparatorTemplate&gt; &lt;br /&gt; &lt;/SeparatorTemplate&gt; &lt;/asp:Repeater&gt; &lt;/div&gt;</pre> <p>&nbsp;<span style="text-decoration: underline;">C#</span></p> <pre class="brush: csharp">protected void ddlNumberOfRows_SelectedIndexChanged(object sender, EventArgs e) { DataTable dt = new DataTable(); dt.Columns.Add(&#34;TextBox&#34;); int count = Convert.ToInt32(ddlNumberOfRows.SelectedItem.Value); for (int i = 0; i &lt; count; i++) { dt.Rows.Add(&#34;&#34;); } this.Repeater1.DataSource = dt; this.Repeater1.DataBind(); }</pre> <p><span style="text-decoration: underline;">Screenshot</span></p> <p><img src="https://i.imgur.com/oa2J6HP.png" alt="" width="193" height="114" /></p>https://www.aspforums.net:443/Threads/112979/How-to-generate-dynamic-TextBoxes-based-on-count-selected-in-DropDownList-in-ASPNet/https://www.aspforums.net:443/Threads/112979/How-to-generate-dynamic-TextBoxes-based-on-count-selected-in-DropDownList-in-ASPNet/Tue, 12 Aug 2014 03:35:30 GMT