title: AngularJs Delete operation not working
body: <p>Below is my code. Its an MVC project on asp.net. Can't find out what is the problem! Create, Update and Retrieve operations work successfully but don't know why delete operation is not working.</p>
  
  <p>Code : </p>
  
  <pre><code>           $scope.delete=function(product)
             {
                 var config = { headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;' } };
                 $http.delete('/Product/Delete',{params:{id:product.ProductId}},config).then(
                      function(response){
                          alert("Deleted");   
                          var index = $scope.Products.indexOf(product);
                          $scope.Products.splice(index, 1);     
                      }
                  );
             };
  </code></pre>
  
  <p>Controller Code :</p>
  
  <pre><code>    [HttpDelete]
      public JsonResult Delete(int id)
      {
          Product oProduct = new Product();
          try
          {
              oProduct.ErrorMessage = oProduct.Delete(id);
          }
          catch (Exception ex)
          {
              oProduct = new Product();
              oProduct.ErrorMessage = ex.Message;
          }
          JavaScriptSerializer serializer = new JavaScriptSerializer();
          string sjson = serializer.Serialize(oProduct);
          return Json(sjson, JsonRequestBehavior.AllowGet);
      }
  </code></pre>
  
  <p>Error Showing :
         DELETE <a href="http://localhost:1693/Product/Delete?id=16" rel="nofollow noreferrer">http://localhost:1693/Product/Delete?id=16</a> 404 (Not Found)</p>
  
  <p>Thanks in advance.</p>