title: How to pass list from view to controller
body: <p>I have problem when pass a list in an object from view to controller, the list is always null. How should I do this?</p>
  
  <p>My model:</p>
  
  <pre><code>public class ImageModel
  {
      public int id { get; set; }
      public string url { get; set; }
      public bool delete { get; set; }
  }
  
  public class SchoolImages
  {
      public Nullable&lt;int&gt; schoolid { get; set; }
      public IList&lt;ImageModel&gt; images;
  }
  </code></pre>
  
  <p>The view:</p>
  
  <pre><code>@model SchoolAppManager.Models.SchoolImages
  
  @using (Html.BeginForm("DeleteImages", "Images"))
  {
  
      @Html.HiddenFor(x =&gt; x.schoolid)
      &lt;table&gt;
      @for (int i = 0; i &lt; Model.images.Count(); i += 4) {
  
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;img src="@Url.Content(Model.images[i].url)" width="50%" /&gt;
                  &lt;br /&gt;
                  @Html.CheckBoxFor(x =&gt; x.images[i].delete)
                  @Html.HiddenFor(x =&gt; x.images[i].id)
              &lt;/td&gt;
              &lt;td&gt;
                  @if (i + 1 &lt; Model.images.Count())
                  {
                      &lt;img src="@Url.Content(Model.images[i + 1].url)" width="50%" /&gt;
                      &lt;br /&gt;
                      @Html.CheckBoxFor(x =&gt; x.images[i + 1].delete)
                      @Html.HiddenFor(x =&gt; x.images[i + 1].id)
                  }
              &lt;/td&gt;
              &lt;td&gt;
                  @if (i + 2 &lt; Model.images.Count())
                  {
                      &lt;img src="@Url.Content(Model.images[i + 2].url)" width="50%" /&gt;
                      &lt;br /&gt;
                      @Html.CheckBoxFor(x =&gt; x.images[i + 2].delete)
                      @Html.HiddenFor(x =&gt; x.images[i + 2].id)
                  }
              &lt;/td&gt;
              &lt;td&gt;
                  @if (i + 3 &lt; Model.images.Count())
                  {
                      &lt;img src="@Url.Content(Model.images[i + 3].url)" width="50%" /&gt;
                      &lt;br /&gt;
                      @Html.CheckBoxFor(x =&gt; x.images[i + 3].delete)
                      @Html.HiddenFor(x =&gt; x.images[i + 3].id)
                  }
              &lt;/td&gt;
          &lt;/tr&gt;
      }
      &lt;/table&gt;
  
      &lt;input type="submit" value="delete" /&gt;
  }
  </code></pre>
  
  <p>When I click delete, <code>SchoolImages</code> is passed to the controller, <code>SchoolImages.schoolId</code> has value in the controller, however, <code>SchoolImages.images</code> is null. How can I pass <code>SchoolImages.images</code> to controller?</p>