title: ASP MVC Radiobutton from model in list
body: <p>I want to show a list of radiobuttons from a model using Entity Framework and MVC 5. 
  The list is displayed with the radiobuttons, but the value of the radiobuttons is always te same for al rows and I can't find a fault in the code. 
  Perhaps someone here have an idea?</p>
  
  <p>Code:</p>
  
  <p>Model:</p>
  
  <pre><code>public class ResultIndexModel
  {
      public IList&lt;ResultInsertModel&gt; resultList { get; set; }
  }
  
  public enum Beoordeling
  {
      Voldoende, 
      Onvoldoende
  }
  public class ResultInsertModel
  {
      public int UserId { get; set; }
      public int ExamId { get; set; }
      public int Id { get; set; }
      public Beoordeling isSufficient { get; set; }
      public Nullable&lt;decimal&gt; Result { get; set; }
  
      public Exam Exam { get; set; }
      public User User { get; set; }
  
  }
  </code></pre>
  
  <p>Examscontroller:</p>
  
  <pre><code>[Authorize]
  public ActionResult AddResults(int? id)
  {
    if (id == null)
    {
       return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
    }
  
    ViewBag.ExamName = ExamCatalog.GetName(id);
  
    return View(ExamCatalog.GetExamStudents(id));
  }
  
  [Authorize]
     [HttpPost]
     [ValidateAntiForgeryToken]
          public ActionResult AddResults([Bind(Include = "Id,Result")] List&lt;ResultInsertModel&gt; model)
          {
              int examId = 0;
              if (ModelState.IsValid)
              {
                  foreach (var i in model)
                  {
                      var c = db.ExamSubscription.Where(a =&gt; a.Id == i.Id).FirstOrDefault();
                      var e = db.Exam.Where(a =&gt; a.Id == c.ExamId).FirstOrDefault();
  
                      if (c != null)
                      {
                          if (!e.ResultIsDecimal)
                          {
                              if (i.isSufficient == Beoordeling.Voldoende)
                              {
  //isSufficient have always the same value Beoordelig.Voldoende ?)
                                  //Voldoende
                                  c.Result = 10;
                              }
                              else
                              {
                                  //onvoldoende
                                  c.Result = 1;
                              }
                          }
                          else
                          {
                              c.Result = i.Result;
                          }
                      }
  
                      examId = c.ExamId;
                  }
  
                  //db.Entry(sub).State = EntityState.Modified;
                  db.SaveChanges();
  
                  //ResultsEntered vullen op examen
                  var exam = db.Exam.Where(a =&gt; a.Id == examId).FirstOrDefault();
  
                  if (exam.ResultsEntered == null)
                  {
                      exam.ResultsEntered = System.DateTime.Now;
  
                      db.Entry(exam).State = EntityState.Modified;
                      db.SaveChanges();
                  }
  
  
              }
              return RedirectToAction("Results", new { id = examId });
          }
  </code></pre>
  
  <p>View: </p>
  
  <pre><code>@Html.RadioButtonFor(model =&gt; model[i].isSufficient, Beoordeling.Voldoende, new { @checked = "checked", id = "voldoende" + i })
                          @Html.Label("voldoende" + i, "Voldoende")
                          @Html.RadioButtonFor(model =&gt; model[i].isSufficient, Beoordeling.Onvoldoende, new { id = "onvoldoende" + i})
                          @Html.Label("onvoldoende" + i, "Onvoldoende")
  </code></pre>
  
  <p>Output HTML:</p>
  
  <pre><code>&lt;input checked="checked" data-val="true" data-val-required="Het veld isSufficient is vereist." id="voldoende0" name="[0].isSufficient" type="radio" value="Voldoende" /&gt;
  &lt;label for="voldoende0"&gt;Voldoende&lt;/label&gt;
  &lt;input id="onvoldoende0" name="[0].isSufficient" type="radio" value="Onvoldoende" /&gt;
  &lt;label for="onvoldoende0"&gt;Onvoldoende&lt;/label&gt;
  </code></pre>
  
  <p>As you can see in the comment in the Controller, isSufficient have always the value 'Beoordeling.Voldoende'. Can you help me?</p>