title: How To Dynamically Add, Remove Input Textbox And Get Values In Blazor Server?
body: <p>I have Blazor server app, and how can I dynamically add new input textboxes on button click and remove it and get the value of all the input textboxes on submit button click so that I can save them in the database.</p>
  <pre><code>@for (int i = count; i &gt;= 1; i--)
  {
  &lt;div class=&quot;row&quot;&gt;
      &lt;input type=&quot;text&quot; @bind-value=&quot;@text_val&quot; /&gt; &lt;p&gt;@i&lt;/p&gt;&lt;p&gt;@count&lt;/p&gt;
  &lt;/div&gt;
  
  }
  &lt;div class=&quot;row&quot;&gt;
  &lt;button @onclick=@(() =&gt; Increment())&gt;Add User&lt;/button&gt;
  &lt;/div&gt;
  
  @code {
          public string text_val;
          public int count = 1;
          public void Increment()
          {
            count = count + 1;
          }
  
  }
  </code></pre>
  <p><br>Any help will be great. Thank you</p>