title: MVC form Post null at controller
body: <p>Building a form that allows user to add infinite lines. This is done with ajax call to controller that adds a partial view (one time per click).</p>
  
  <p>I am using Html.BeginCollectionItem to index each input in the partial views.</p>
  
  <p>I can add a bunch of items and click submit, I can see the form is posted in fiddler, but the controller shows a null form.  If I change the post controller type from List&lt;> to singular AccessoryVM, I get the first item.</p>
  
  <p>I have tried swaping the model type in the Index view from List to IEnumerable, no change.</p>
  
  <p>Index:</p>
  
  <pre><code>@model List&lt;EmployeeHardwareRequest.Models.ViewModels.AccessoryVM&gt;
  
  @{
      ViewBag.Title = "Select Accessories";
  }
  
  &lt;h2&gt;Accessories&lt;/h2&gt;
  
  
      @using (Html.BeginForm("Index", "Accessory", FormMethod.Post, new { @class = "form-horizontal" }))
      {
          @Html.AntiForgeryToken()
          @Html.ValidationSummary(true, "", new { @class = "text-danger" })
          &lt;div id="form-body"&gt;
              @foreach (var item in Model)
              {
                  @Html.Partial("_NewItem")
              }
          &lt;/div&gt;
  
          &lt;div class="row"&gt;
              &lt;div class="col-md-6"&gt;
                  &lt;button id="add-item" class="btn btn-primary"&gt;Add Another Item&lt;/button&gt;
              &lt;/div&gt;
              &lt;div class="col-md-6"&gt;
                  &lt;input type="submit" value="Select Software" class="btn btn-default pull-right" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      }
  </code></pre>
  
  <p>Partial:</p>
  
  <pre><code>@model EmployeeHardwareRequest.Models.ViewModels.AccessoryVM
  
  &lt;div class="form-group col-md-3"&gt;
      &lt;div&gt;
          @Html.DropDownListFor(model =&gt; model.SelectedAccessory, Model.AccessoryDdl, new { @class = "form-control accessoryList" })
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="form-group col-md-8"&gt;
      &lt;div&gt;
          @using (Html.BeginCollectionItem("AccessoryVM"))
          {
              @Html.EditorFor(model =&gt; model.ProductLink, new { htmlAttributes = new { @class = "form-control", @placeholder = "Enter link to web page" } })
              @Html.ValidationMessageFor(model =&gt; model.ProductLink, "", new { @class = "text-danger" })
          }
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="col-md-1"&gt;
      &lt;button type="button" id="deleteItem" class="btn btn-danger"&gt;
          &lt;span class="glyphicon glyphicon-remove"&gt;&lt;/span&gt;
      &lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Controllers:
  Index:
          public ActionResult Index()
          {
              List modelList = new List();</p>
  
  <pre><code>        List&lt;Accessory&gt; accessories = _db.Accessory.ToList();  // change this to use the accessoryDTO
  
          List&lt;int&gt; monitorSizeList = new List&lt;int&gt;  // replace this with data from db table.
          {
              20, 22, 24, 27
          };
  
          model.AccessoryDdl = new SelectList(accessories, "AccessoryId", "ItemDescription", selectedAcc);
          model.MonitorSizeDdl = new SelectList(monitorSizeList);
          return View(modelList);
      }
  </code></pre>
  
  <p>Get partial view:</p>
  
  <pre><code>    public ActionResult AddItem(int index)
      {
          AccessoryVM model = new AccessoryVM();
          int selectedAcc = 1;
  
          List&lt;Accessory&gt; accessories = _db.Accessory.ToList();  // change this to use the accessoryDTO
  
          List&lt;int&gt; monitorSizeList = new List&lt;int&gt;  // replace this with data from db table.
          {
              20, 22, 24, 27
          };
  
          //model.lineIndex = index++;
  
          model.AccessoryDdl = new SelectList(accessories, "AccessoryId", "ItemDescription", selectedAcc);
          model.MonitorSizeDdl = new SelectList(monitorSizeList, "Select Monitor Size");
          return PartialView("_NewItem", model);
      }
  </code></pre>
  
  <p>post:</p>
  
  <pre><code>    [HttpPost]
      public ActionResult Index(List&lt;AccessoryVM&gt; form)
      {
  </code></pre>
  
  <p>I have checked for double use of keywords and properties, but don't see any conflicts.</p>