title: Cancel button in MVC
body: <p>I have a panel within a form that has 3 buttons save, edit and cancel.<br>
  When the user clicks on edit, the labels inside the panel change to textboxes wherein the user can edit the content. This part is done.<br>
  Now if the user has edited the content, but does not wish to save it, he clicks on cancel. When he does so, the edited text will be replace with the original content of the labels(data comes from the model).<br>
  I have followed the accepted answer given <a href="https://stackoverflow.com/questions/8439394/how-can-i-implement-a-delete-and-cancel-button-in-mvc3">here</a></p>
  
  <p>Controller:</p>
  
  <pre><code>[HttpPost]
      public ActionResult Submit(int id, string actionType)
      {
          var model = new CustomerDetailsViewModel();
          var custid = db.Customers.Find(id);
          if(actionType == "Cancel")
          {
              model.Company = custid.Company;
              model.Address = custid.Address;
              model.FullName = custid.FirstName + " " + custid.LastName;
              model.EMail = custid.EMail;
              model.Phone = custid.Phone;
              model.EntryDate = custid.EntryDate;
              model.LastInterestShown = custid.LastInterestShown;
              model.ID = custid.ID;
              model.Status = custid.Status;
          }
          return PartialView(model);
      }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>&lt;input type="submit" value="Cancel" id="btncancel" name="actionType" class="btn btn-default" /&gt;
  </code></pre>
  
  <p>JS:</p>
  
  <pre><code>        $("#btnCancel").click(function(e){
          e.preventDefault();
          $.ajax({
              url: '/Client/Submit',
              type: 'POST',
              async: false
      });
  });
  </code></pre>
  
  <p>Can someone tell me where am I going wrong?</p>