title: Cannot refresh page after deleting a row in a grid
body: <p>Can anyone see why this code doesn't work?
  I know that someone will notice that I am using Delete links and I should be using a DELETE verb rather than a POST, but I have not been able to resolve that issue, even with the help of SO. 
  No the issue here is that I click on delete, the underlying data gets deleted OK, but after I delete the data, when I try to redirect to the Payroll GET method, it does not get called and as a result the screen does not get refreshed.
  So here is the code on the Controller;</p>
  
  <pre><code>[HttpGet]
  [Authorize(Roles = "Administrator, AdminAccounts, ManagerAccounts")]
  public ActionResult Payroll()
  {
      if ((SessionObjects.PeriodStartDate &gt; DateTime.MinValue) &amp;&amp; (SessionObjects.PeriodEndDate &gt; DateTime.MinValue))
          if (SessionObjects.PayrollSelectedEmployeeId == 0)
              return View(new PayrollViewModel()
                  {
                      PeriodStartDate = SessionObjects.PeriodStartDate,
                      PeriodEndDate = SessionObjects.PeriodEndDate
                  });
          else
              return View(new PayrollViewModel(
                  SessionObjects.PeriodStartDate,
                  SessionObjects.PeriodEndDate,
                  SessionObjects.PayrollSelectedEmployeeId
                  ));
  
      return View();
  }
  
  [HttpPost]
  [Authorize(Roles = "Administrator, AdminAccounts, ManagerAccounts")]
  public ActionResult Payroll(PayrollViewModel _pvm)
  {
      if (ModelState.IsValid)
      {
          SessionObjects.PeriodStartDate = _pvm.PeriodStartDate;
          SessionObjects.PeriodEndDate = _pvm.PeriodEndDate;
          if (_pvm.SearchTextId &gt; 0)
              SessionObjects.PayrollSelectedEmployeeId = _pvm.SearchTextId;
          return RedirectToAction("Payroll");
      }
      return View(_pvm);
  }
  
  //[AcceptVerbs(HttpVerbs.Delete)]
  [HttpPost]
  [Authorize(Roles = "Administrator, AdminAccounts, ManagerAccounts")]
  public RedirectToRouteResult Delete(int id)
  {
      EmployeeOtherLeaf.Delete(id);
      return RedirectToAction("Payroll");
  }
  </code></pre>
  
  <p>Part of the View and Editor Template;</p>
  
  <pre><code>    &lt;table class="groupBorder"&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;/th&gt;
              &lt;th&gt;Leave Type&lt;/th&gt;
              &lt;th&gt;Notes&lt;/th&gt;
              &lt;th&gt;Day Amount&lt;/th&gt;
              &lt;th&gt;Date&lt;/th&gt;
              &lt;th&gt;Approver&lt;/th&gt;
          &lt;/tr&gt;
          &lt;%: Html.EditorFor(x =&gt; x.LeaveList)%&gt;
      &lt;/table&gt;
  
  &lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;SHP.WebUI.Models.Leave&gt;" %&gt;
  &lt;%@ Import Namespace="SHP.WebUI.HtmlHelpers" %&gt;
  &lt;%@ Import Namespace="SHP.Models" %&gt;
  
  &lt;%: Html.RowStyle(Model.RowColour) %&gt;
  &lt;tr&gt;
      &lt;td style="background-color:White;"&gt;
          &lt;%-- Ajax Delete --%&gt;
          &lt;% if(Model.LeaveId &gt; 0) { %&gt;
          &lt;%: Html.DeleteEmployeeOtherLeave()%&gt;
          &lt;%} %&gt;
      &lt;/td&gt;
      &lt;td&gt;&lt;%: Model.LeaveType %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%: Model.Notes %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%: Model.DayAmount %&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%: String.Format("{0:ddd MMM d yyyy}", Model.Date)%&gt;&lt;/td&gt;
      &lt;td&gt;&lt;%: Model.ApproverName %&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;    &lt;%-- Leave this here, it closes from the above Html.RowStyle!--%&gt;
  </code></pre>
  
  <p>HTML Helper method;</p>
  
  <pre><code>public static MvcHtmlString DeleteEmployeeOtherLeave(this HtmlHelper&lt;Leave&gt; html)
  {
      var leave = html.ViewData.Model;
      return html.RouteLink(
          "Delete",
          "Default",
          new {id = leave.LeaveId, action = "Delete" },
          new { onclick = "return DeleteRow(this);" }
      );
  }
  </code></pre>