$.ajax({ url: "/Employee/SubmitInformation", dataType: 'json', data: { EmployeeID: EmpID, EmpName: empName }, type: "POST", cache: false, success: function (data) { //want to return data as not boolean but string here }, error: function (a, b, c) { alert("Error") } });
[HttpPost] public ActionResult SubmitInformation(int EmployeeID,string EmpName) { //after successful entry of information //return success message return Json("success", JsonRequestBehavior.AllowGet); }
return Content("success");
success: function (data) { if(data == "success") }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)