title: Passing list from view to controller MVC3
body: <p>after deep searching I couldn't find any solution.
  I have a Ajax.BeginForm which needs to pass a list containing information about the checked rows.</p>
  
  <p>UnitsChecked Class (Model)</p>
  
  <pre><code>public class UnitsChecked
  {
      public bool IsChecked { get; set; }
      public TaxiTV.Data.Entity.Unit Unit { get; set; }
  }
  </code></pre>
  
  <p>ReportsVM (View Model Class)</p>
  
  <pre><code>public class ReportsVM 
  {
      public IEnumerable&lt;UnitsChecked&gt; UnitList { get; set; }
      public ReportsVM()
      {
           UnitList = new List&lt;UnitsChecked&gt;();
      }
  }
  </code></pre>
  
  <p>Index.cshtml (View)</p>
  
  <pre><code>@using (Ajax.BeginForm("GetReports", "Reports", new AjaxOptions { UpdateTargetId = "ReportList", LoadingElementId = "loader" })) 
  {
      &lt;table class="tableBorder"&gt;
          &lt;tr&gt;
              &lt;th&gt;Choose
              &lt;/th&gt;
              &lt;th&gt;
                  @Resources.IMEI
              &lt;/th&gt;
              &lt;th&gt;
                  @Resources.SIM
              &lt;/th&gt;
              &lt;th&gt;
                  @Resources.Name
              &lt;/th&gt;
          &lt;/tr&gt;
          @for (int i = 0; i &lt; Model.UnitList.Count(); i++ )
          {
              &lt;tr&gt;
                  &lt;td&gt;
                      @Html.CheckBoxFor(m =&gt; m.UnitList.ElementAt(i).IsChecked, new { @class = "checkboxListener" })
                  &lt;/td&gt;
                  &lt;td&gt;
                      @Html.DisplayFor(m=&gt; m.UnitList.ElementAt(i).Unit.IMEI)
                      @Html.Hidden("zzz", Model.UnitList.ElementAt(i)) &lt;---- This line
                  &lt;/td&gt;
                  &lt;td&gt;
                      @Model.UnitList.ElementAt(i).Unit.SIM
                  &lt;/td&gt;
                  &lt;td&gt;
                      @Model.UnitList.ElementAt(i).Unit.Person.FirstName @Model.UnitList.ElementAt(i).Unit.Person.LastName
                  &lt;/td&gt;
              &lt;/tr&gt;
          }
      &lt;/table&gt;
  }
  </code></pre>
  
  <p>The main and most important line is where the arrow points.
  Using Fiddler2 I managed to see that all the list of UnitsChecked is sent one by one.
  The following controller says the "zzz" is null.</p>
  
  <pre><code>[HttpPost]
          public ActionResult GetReports(ReportsVM rvm, List&lt;UnitsChecked&gt; zzz)
      {
  </code></pre>
  
  <p>Any suggestions? 
  Thank you.</p>