title: Using BeginCollectionItem with MVC Core
body: <p>I don't appear to be having the same issues as most with the implementation of BeginCollectionItem with MVC core, I'm not receiving any of the data.</p>
  
  <p>I have this main page that has alot of work on it but here is the javascript that adds new sections to the page and the partial that will be added below.</p>
  
  
  
  <pre class="lang-cs prettyprint-override"><code>@model QuizBuilderModel
  ...
  function addSection() {
      $.ajax({
          url: '@Url.Action("AddSection","Quiz")',
          cache: false,
          success: function (html) {
          $("#sortable-survey").append(html);
          }
      });
  }
  ...
  
  &lt;div class="quiz-builder" id="quiz-builder" style="@((Model.Quiz == null || string.IsNullOrEmpty(Model.Quiz.Id))? "display: none;" : "")"&gt;
          @{await Html.RenderPartialAsync("~/Views/Admin/Quiz/_QuizBuilder.cshtml", Model);}
  &lt;/div&gt;
  </code></pre>
  
  <p>Now, we have this partial to start the form we're building.</p>
  
  <pre class="lang-cs prettyprint-override"><code>@model QuizBuilderModel
  
  &lt;div id="sortable-survey" class="sortable-survey"&gt;
      @using (Html.BeginForm("PostQuizUpdate", "Quiz", FormMethod.Post))
      {
          @if (Model.Quiz != null &amp;&amp; !string.IsNullOrEmpty(Model.Quiz.Id))
          {
              &lt;input type="submit" class="btn btn-lg btn-outline-primary top-right-button top-right-button-single" id="SaveQuizModal" name="SaveQuizModal" value="Save Quiz" /&gt;
          }
  
          @if (Model.Quiz != null &amp;&amp; Model.Quiz.Sections != null)
          {
              foreach (Sections section in Model.Quiz.Sections)
              {
                  await Html.RenderPartialAsync("~/Views/Admin/Quiz/_Section.cshtml", Model);
              }
          }
      }
  &lt;/div&gt;
  
  &lt;div&gt;
      &lt;div class="text-center"&gt;
          &lt;button type="button" class="btn btn-outline-primary btn-sm my-5" id="AddSection" onclick="addSection();"&gt;
              &lt;i class="simple-icon-plus btn-group-icon"&gt;&lt;/i&gt;
              Add Section
          &lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Then I have this partial section where we'll be adding more and more to it.</p>
  
  <pre class="lang-cs prettyprint-override"><code>@using HtmlHelpers.BeginCollectionItemCore
  @model Sections
  
  @using (Html.BeginCollectionItem("Sections"))
  {
      &lt;div class="form-group"&gt;
          @Html.LabelFor(x =&gt; x.Title);
          @Html.EditorFor(m =&gt; m.Title, new { @class = "form-control" })
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label&gt;SubTitle (optional)&lt;/label&gt;
          @Html.EditorFor(m =&gt; m.SubTitle, new { @class = "form-control" })
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
          &lt;label&gt;Instructions (optional)&lt;/label&gt;
          &lt;textarea type="text" class="form-control" placeholder="" id="Instructions" name="Instructions" required rows="10" cols="50"&gt;&lt;/textarea&gt;
      &lt;/div&gt;
  }
  </code></pre>
  
  <p>The response of the post is sent here...</p>
  
  <pre class="lang-cs prettyprint-override"><code>[HttpPost]
  public async Task&lt;IActionResult&gt; PostQuizUpdate(IEnumerable&lt;Sections&gt; Sections)
  {
      ...
  }
  </code></pre>
  
  <p>Like i said before when I hit the submit I'm not getting the list of Sections in the post.</p>