title: I am struggling to pass data to controller through Ajax
body: <p>Trying to hit <code>DeleteJobQuote</code> controller  through Ajax but no luck. Please guide me if anyone has any idea about it. The code seems OK but not able to do so. I am writing this code to delete a particular record from database. </p>
  
  <p><strong>Controller</strong></p>
  
  <pre class="lang-cs prettyprint-override"><code>[HttpPost]
  public ActionResult DeleteJobQuote(int jobQuoteid)
  {
      using (var db = new KeysEntities())
      {
          var delJob = db.JobQuote.FirstOrDefault(x =&gt; x.Id == jobQuoteid);
          if (delJob != null)
          {
              delJob.Status = "Delete";
              db.SaveChanges();
              return Json(new { success = true, Message = "JobQuote SuccessFully Deleted!" });
          }
          else
          {
              return Json(new { success = false, Message = "Delete UnSuccessFul " });
          }
      }
  }
  </code></pre>
  
  <p><strong>And JavaScript and Knockout code for this</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>self.deleteJobQuote = function (jobQuote) {
      debugger;
      $.ajax({
          url: '/Companies/Manage/DeleteJobQuote',
          type: 'POST',
          dataType: 'json',
          data: ko.toJSON(this),
          contentType: 'application/json',
          success: function (result) {
              if (result.success) {
                  $('#jobQuoteDeleteModal').modal('show');
              }
              else {
                  alert("You can not delete this record !!");
              }
          }
      });
  };
  </code></pre>