title: jQuery Ajax POST in MVC3
body: <p>When I delete an item from the DB using jQuery.ajax with POST method, I get this error:</p>
  
  <pre><code>GET Http://localhost:54010/Admin/Category/Delete?id=77 404 Not Found
  </code></pre>
  
  <p>Action in CategoryController:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Delete(int id) {
    try {
      db.CategoryRepository.Delete(id);
      db.Save();
      return Json(new {Result = "OK"});
    } catch (Exception ex) {
      return Json(new { Result = "ERROR", Message = ex.Message });
    }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;a id="delete-category" class="btn btn-small" href="#"&gt;
    &lt;i class="icon-remove"&gt;&lt;/i&gt;
    @Resource.delete
  &lt;/a&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>$(function () {
    $('#delete-category').click(function (event) {
      event.preventDefault();
      $.ajax({
        method: 'POST',
        url: '@Url.Action("Delete","Category")',
        dataType: 'json',
        data: { id: '@Model.CategoryModel.Id' },
        success: function (data, textStatus, jqXHR) {
          console.log("success");
        },
        error: function () {
          alert('error');
        }
      });
    });
  });
  </code></pre>
  
  <p>Why does the click event not generate POST?</p>