title: ASP.NET MVC save button loading but not working
body: <p>I have implemented a save button in my .NET application on the index page. When I click it, it loads, but does not save anything. I am just using the index page for checkboxes. If I uncheck something and save it, it saves, but also unchecks everything else in that row. Nothing happens when I try to check something. Here is the code I'm using:</p>
  
  <p>Index.cshtml</p>
  
  <pre><code>@using (Html.BeginForm("save", "drnos"))
  {
      &lt;input type="submit" value="Save" /&gt;
  }
  </code></pre>
  
  <p>An example of one of my check box fields:</p>
  
  <pre><code>&lt;td&gt;
      @Html.EditorFor(modelItem =&gt; item.Soft)
      @Html.ValidationMessageFor(modelItem =&gt; item.Soft)
  &lt;/td&gt;
  </code></pre>
  
  <p>drnosController.cs</p>
  
  <pre><code>[HttpPost]
  public ActionResult save(Doctor doc)
  {
      System.Diagnostics.Debug.WriteLine("Save Called");
      db.Entry(doc).State = EntityState.Modified;
      db.SaveChanges();
      return RedirectToAction("Index");  
  }
  </code></pre>
  
  <p>Here is the whole HTML file:</p>
  
  <pre><code>@model PagedList.IPagedList&lt;drnosv6.Models.Doctor&gt;
  @using PagedList.Mvc;
  
  &lt;link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" /&gt;
  
  
  @{
      ViewBag.Title = "Index";
  }
  
  &lt;h2&gt;Doctors&lt;/h2&gt;
  
  &lt;p&gt;
      @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  @using (Html.BeginForm()) //insert the search bar
  {
      &lt;p&gt;
          Find by First Name, Last Name, or RVH ID: @Html.TextBox("SearchString")
  
          &lt;input type="submit" value="Search" /&gt;
  
      &lt;/p&gt;
  }
  
  @using (Html.BeginForm("save", "drnos"))
  {
      &lt;input type="submit" value="Save" /&gt;
  }
  
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(document).ready(function () {
          $('tr:even').addClass('alt-row-class');
      });
  
  &lt;/script&gt;
  
  &lt;p&gt;    
  &lt;/p&gt;
  
  &lt;p&gt;Click on a column header to sort by that column&lt;/p&gt;
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;
              @Html.ActionLink("RVH ID", "Index", new { sortOrder = ViewBag.IDSortParm })
          &lt;/th&gt;
  
          &lt;th&gt;
              @Html.ActionLink("Last Name", "Index", new { sortOrder = ViewBag.LastSortParm })
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("First Name", "Index", new { sortOrder = ViewBag.FirstSortParm })
          &lt;/th&gt;
          &lt;th&gt;
              Middle Initial
          &lt;/th&gt;
          &lt;th&gt;
              Degree
          &lt;/th&gt;
          &lt;th&gt;
              Group
          &lt;/th&gt;
          &lt;th&gt;
              Adm Priv
          &lt;/th&gt;
  
          &lt;th&gt;
              @Html.ActionLink("QCPR", "Index", new { sortOrder = ViewBag.QCPRSortParm })
  
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("Keane", "Index", new { sortOrder = ViewBag.KeaneSortParm })
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("Orsos", "Index", new { sortOrder = ViewBag.OrsosSortParm })
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("Soft", "Index", new { sortOrder = ViewBag.SoftSortParm })
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("3M", "Index", new { sortOrder = ViewBag.threeMSortParm })
          &lt;/th&gt;
  
          &lt;th&gt;&lt;/th&gt;
      &lt;/tr&gt;
  
      @foreach (var item in Model)
      { 
          using (Html.BeginForm("Save", "Doctor", FormMethod.Post))
  
      {
          &lt;tr&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.RVH_ID_)
              &lt;/td&gt;
  
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.Last_Name)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.First_Name)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.Middle_Name)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.Degree1)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.Group)
              &lt;/td&gt;
  
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.AdmPriv)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.QCPR)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.EditorFor(modelItem =&gt; item.Keane)
                  @Html.ValidationMessageFor(modelItem =&gt; item.Keane)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.EditorFor(modelItem =&gt; item.Orsos)
                 @Html.ValidationMessageFor(modelItem =&gt; item.Orsos)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.EditorFor(modelItem =&gt; item.Soft)
                  @Html.ValidationMessageFor(modelItem =&gt; item.Soft)
              &lt;/td&gt;
              &lt;td&gt;
                  @Html.DisplayFor(modelItem =&gt; item.C3M)
              &lt;/td&gt;
  
              &lt;td&gt;
                  @Html.ActionLink("Edit", "Edit", new { id = item.RVH_ID_ })
                  @Html.ActionLink("Details", "Details", new { id = item.RVH_ID_ })
  
              &lt;/td&gt;
          &lt;/tr&gt;
      }
      }
  
  &lt;/table&gt;
  
  &lt;p&gt;
      &lt;input type="submit" value="Save" /&gt;
  &lt;/p&gt;
  &lt;br /&gt;
  Page @(Model.PageCount &lt; Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
  
  @Html.PagedListPager(Model, page =&gt; Url.Action("Index", new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))
  </code></pre>