title: How to get Button to Update Database?
body: <p>I have a View where in a GridView is generated of checklist to do items. One particular item is status. If the item isn't done, a button is shown to mark the item as done as well as mark who clicked the button and when:</p>
  
  <pre><code>    &lt;td&gt;
          @if (item.status.Equals("Done"))
          {
              @Html.DisplayFor(modelItem =&gt; item.status)
          }
          else
          {
              &lt;input type="button" title="TestTitle" value="TestValue" onclick="location.href='@Url.Action("Update", "Checklist", new { item = item})'" /&gt;
          }
      &lt;/td&gt;
  </code></pre>
  
  <p>I took the code from the scaffolded Edit and modified it slightly in my ChecklistController as all I want to do is modify three columns in the DB:</p>
  
  <pre><code>[HttpPost]
  [ValidateAntiForgeryToken]
  public ActionResult Update([Bind(Include = "ID,ww,taskitem,owner,manager,project,status,applied_by,timestamp")] TaskItem taskItem)
  {
      taskItem.timestamp = DateTime.UtcNow;
      taskItem.applied_by = System.Web.HttpContext.Current.User.Identity.Name;
      taskItem.status = "Done";
  
      if (ModelState.IsValid)
      {
          db.Entry(taskItem).State = EntityState.Modified;
          db.SaveChanges();
          return RedirectToAction("Index");
      }
      return View("Index", db.TaskItemSet.ToList());
  }
  </code></pre>
  
  <p>I'm somewhat new to binding and anon types so regardless of using <code>new { item = item}</code>, <code>new { id = item.id}</code> or <code>new {item}</code> I get:</p>
  
  <blockquote>
    <p>Server Error in '/' Application.</p>
    
    <p>The resource cannot be found.</p>
    
    <p>Description: HTTP 404. The resource you are looking for (or one of its
    dependencies) could have been removed, had its name changed, or is
    temporarily unavailable.  Please review the following URL and make
    sure that it is spelled correctly. </p>
    
    <p>Requested URL: /Checklist/Update</p>
    
    <p>Version Information: Microsoft .NET Framework Version:4.0.30319;
    ASP.NET Version:4.6.81.0</p>
  </blockquote>
  
  <p>What am I doing wrong and how do I get to do what I want?</p>