title: Editable Table in MVC
body: <p>I've been having trouble figuring out how to edit table items on a webpage, and post them back to the server.  (actually, in this case, I just want the user to select checkboxes, as though they are selecting multiple items, but that's just the implimentation).</p>
  
  <p>The problem is that, while the view shows up on the webpage, in HttpPost, picSelections is null.</p>
  
  <p>This is at the top of my View:</p>
  
  <pre><code>@model IEnumerable&lt;CarShow.lmit_pics&gt;
  
  @using (Html.BeginForm())
  {    
  &lt;div style="width:100%; height:60px; "&gt;
  &lt;input type="submit" value="Add Selected Photo(s) to Survey" /&gt;
  &lt;/div&gt;
  
      for (int i = 0; i &lt; Model.Count(); i++)
      {
          var item = Model.ElementAt(i);
      &lt;div style="width:296px; float:left"&gt;
  
              &lt;div style="float:left; width:200px; margin-bottom:18px"&gt;
  
                  @{string cropped = "../../../Content/Images/" + Html.DisplayFor(modelItem =&gt; item.picname).ToString() + "?" + Html.DisplayFor(modelItem =&gt; item.version).ToString();
                   }
                  &lt;img alt="picture" class="pic-size" src="@cropped" /&gt;
                  &lt;br /&gt;
                      @Html.EditorFor(modelItem =&gt; item.brand)
              &lt;/div&gt;
  
  &lt;/div&gt;
          }    
  }
  &lt;/div&gt;
  </code></pre>
  
  <p>This is in the controller:</p>
  
  <pre><code>public ActionResult AddSurveyPic(string id)
  {
     var validPicSummaries = (IEnumerable)(from x in db.lmit_pics where x.enabled == 1 select x);
     return View((IEnumerable)validPicSummaries);
  }
  
  [HttpPost]
  public ActionResult AddSurveyPic(IEnumerable&lt;CarShow_MVC.lmit_pics&gt; picSelections)
  {
          // Save data here
  }
  </code></pre>
  
  <p>Thanks.</p>