title: Add row dynamically and pass the value to controller
body: <p><strong>Scenario :</strong> Initially my form has no rows. When I click add button a new row is created and I enter details in it. If I want another row, I click add button and enter details. When all the details are added, I click submit, which sends all the information to the controller.</p>
  
  <p><strong>Here is my code :</strong> </p>
  
  <p>RoomOperation.cshtml</p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;div class="col s4"&gt;
      Item Name
    &lt;/div&gt;
    &lt;div class="col s2"&gt;
      Rate
    &lt;/div&gt;
    &lt;div class="col s2"&gt;
      Qty
    &lt;/div&gt;
    &lt;div class="col s2"&gt;
      Total
    &lt;/div&gt;
    &lt;div class="col s1"&gt;
      &lt;a class="btn-floating btn-xs waves-effect waves-light red" onclick="addItems()"&gt;&lt;i class="material-icons"&gt;add&lt;/i&gt;&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  
  @using (Html.BeginForm("PostChargesPV","Home"))
  {
      &lt;div class="addItem"&gt;
          @{ Html.RenderPartial("PostChargesPV"); }
      &lt;/div&gt;
      &lt;button type="submit"&gt;Save Bill&lt;/button&gt;
  }
  ...
  &lt;script type="text/javascript"&gt;
    function addItems() {
      $(".addItem").append($("div.singleItem").html());
    }
  &lt;/script&gt;
  </code></pre>
  
  <p>PostChargesPV.cshtml</p>
  
  <pre><code>@model HMS.Reports.ViewModel.HouseKeeping.RoomPostCharges
  &lt;div class="singleItem"&gt;
    &lt;div class="col s4"&gt;
      @Html.TextBoxFor(x=&gt;x.itemName)
    &lt;/div&gt;
    &lt;div class="col s2"&gt;
      @Html.TextBoxFor(x =&gt; x.rate)
    &lt;/div&gt;
    &lt;div class="col s2"&gt;
      @Html.TextBoxFor(x =&gt; x.qty)
    &lt;/div&gt;
    &lt;div class="col s2"&gt;
      @Html.TextBoxFor(x =&gt; x.total)
    &lt;/div&gt;
    &lt;div class="col s1"&gt;
      &lt;a class="btn-floating btn-xs waves-effect waves-light red" onclick="removeItem()"&gt;&lt;i class="material-icons"&gt;remove&lt;/i&gt;&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>HomeController.cs</p>
  
  <pre><code>[HttpPost] 
  public ActionResult PostChargesPV(List&lt;RoomPostCharges&gt; pc) 
  { 
    //pc is null
    return PartialView(); 
  }
  </code></pre>
  
  <p>I got my desired UI but the data is not passing to the controllers. Any advice would be helpful. Thank you.</p>
  
  <p>If there is any alternate way. Please let me know.</p>
  
  <p><a href="https://i.stack.imgur.com/Ow5MB.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ow5MB.gif" alt="enter image description here"></a></p>