MVC Selected Checkboxs null on postback
<p>I am running to an issue with .net and MVC.  I am trying to select a group of images that is being rendered on the webpage correctly, select a few images via a checkbox, and delete those images.  However, the controller is null with no data so I cant do anything with it.  Can someone steer me in the correct direction?</p>

<p>EditImages.cshtml</p>

<pre><code>@model Images

@{
ViewBag.Title = "EditImages";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section CSS
{
&lt;style&gt;
    .Image {
        position: relative;
        float: left;
        margin-left: 10px;
        border-color: white;
        border-style: solid;
        border-spacing: 100px;
        margin-top: 10px;
        color: red;
    }

    .checkbox {
        position: relative;
    }
&lt;/style&gt;
}
&lt;h2&gt;EditImages&lt;/h2&gt;

@using (Html.BeginForm("DeleteImages", "Image", FormMethod.Post))
{
for (var i = 0; i &lt; Model.ImageList.Count(); i++)
{
    var modellist = Model.ImageList.ToList();
    &lt;div class="Image"&gt;            
        &lt;p class="Image.Font"&gt;@Html.DisplayFor(m =&gt;     modellist[i].FileName&lt;/p&gt;
        &lt;p&gt;@Html.DisplayFor(m =&gt; modellist[i].FullImage.Width) x @Html.DisplayFor(m =&gt; modellist[i].FullImage.Height)&lt;/p&gt;

        &lt;img src="data:image/jpg;base64,@(Html.Raw(Convert.ToBase64String( modellist[i].ByteArray)))" height="225" width="400" /&gt;          
        &lt;p&gt;@Html.CheckBoxFor(m =&gt; modellist[i].isSelected, new {  id = modellist[i].id  })&lt;/p&gt;
        &lt;label&gt;@modellist[i].id&lt;/label&gt;            
    &lt;/div&gt;
}

&lt;p&gt;&lt;input type="submit" id="delete" title="Delete1" value="Delete Images" /&gt;&lt;/p&gt;
}
</code></pre>

<p>Controller - ImageController</p>

<pre><code>    [HttpPost]
    public ActionResult DeleteImages(Images model)
    {
        //var temp = new Lobby_Monitor.Models.Images();
        //temp = model;

        string a = "";

        return View();
    }
</code></pre>

<p>Model - Images</p>

<pre><code> public class Images
{
    public int id { get; set; }
    public string FileName { get; set; }
    public string Extension { get; set; }

    public byte[] ByteArray { get; set; }

    public string UserId { get; set; }

    public string UserName { get; set; }

    public HttpPostedFileBase postedFile { get; set; }

    public string stream_id { get; set; }

    public Image FullImage { get; set; }

    public IEnumerable&lt;DBImages&gt; ImageList { get; set; }

    public Boolean isSelected { get; set; }

}
</code></pre>

<p>I''ve ran this through Fiddler to see what was being posted.  There is data being posted.  I believe with this test, I clicked the first 2 images.</p>

<pre><code>Name                      Value
modellist[0].isSelected    true
modellist[0].isSelected    false
modellist[1].isSelected    true
modellist[1].isSelected    false
modellist[2].isSelected    false
modellist[3].isSelected    false
modellist[4].isSelected    false
</code></pre>

<p><a href="https://i.stack.imgur.com/isrqV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/isrqV.png" alt="enter image description here"></a></p>

<p>Sample of Generated HTML</p>

<pre><code>    &lt;div class="Image"&gt;            
        &lt;p class="Image.Font"&gt;Capture.PNG&lt;/p&gt;
        &lt;p&gt;1667 x 866&lt;/p&gt;

        &lt;img src="image stuff" height="225" width="400" /&gt;


        &lt;p&gt;&lt;input data-val="true" data-val-required="The isSelected field is required." id="2" name="modellist[1].isSelected" type="checkbox" value="true" /&gt;&lt;input name="modellist[1].isSelected" type="hidden" value="false" /&gt;&lt;/p&gt;
        &lt;label&gt;2&lt;/label&gt;
        &lt;p&gt;&lt;input type="submit" id="delete" title="Delete1" value="Delete Images" /&gt;&lt;/p&gt;
    &lt;/div&gt;
    &lt;div class="Image"&gt;            
        &lt;p class="Image.Font"&gt;tunein.png&lt;/p&gt;
        &lt;p&gt;703 x 753&lt;/p&gt;

        &lt;img src="image stuff" height="225" width="400" /&gt;


        &lt;p&gt;&lt;input data-val="true" data-val-required="The isSelected field is required." id="3" name="modellist[2].isSelected" type="checkbox" value="true" /&gt;&lt;input name="modellist[2].isSelected" type="hidden" value="false" /&gt;&lt;/p&gt;
        &lt;label&gt;3&lt;/label&gt;
        &lt;p&gt;&lt;input type="submit" id="delete" title="Delete1" value="Delete Images" /&gt;&lt;/p&gt;
    &lt;/div&gt;
    &lt;div class="Image"&gt;            
        &lt;p class="Image.Font"&gt;Qatar-Museum-1920x1080.jpg&lt;/p&gt;
        &lt;p&gt;1920 x 1080&lt;/p&gt;

        &lt;img src="" height="225" width="400" /&gt;


        &lt;p&gt;&lt;input data-val="true" data-val-required="The isSelected field is required." id="4" name="modellist[3].isSelected" type="checkbox" value="true" /&gt;&lt;input name="modellist[3].isSelected" type="hidden" value="false" /&gt;&lt;/p&gt;
        &lt;label&gt;4&lt;/label&gt;
        &lt;p&gt;&lt;input type="submit" id="delete" title="Delete1" value="Delete Images" /&gt;&lt;/p&gt;
    &lt;/div&gt;
    &lt;div class="Image"&gt;            
        &lt;p class="Image.Font"&gt;Brooklyn-College-1920x1080.jpg&lt;/p&gt;
        &lt;p&gt;1920 x 1080&lt;/p&gt;

        &lt;img src="image info" height="225" width="400" /&gt;


        &lt;p&gt;&lt;input data-val="true" data-val-required="The isSelected field is required." id="5" name="modellist[4].isSelected" type="checkbox" value="true" /&gt;&lt;input name="modellist[4].isSelected" type="hidden" value="false" /&gt;&lt;/p&gt;
        &lt;label&gt;5&lt;/label&gt;
        &lt;p&gt;&lt;input type="submit" id="delete" title="Delete1" value="Delete Images" /&gt;&lt;/p&gt;
    &lt;/div&gt;
&lt;p&gt;&lt;input type="submit" id="delete" title="Delete1" value="Delete Images" /&gt;&lt;/p&gt;
</code></pre>

<p></p>