$.ajax({ type: "POST", url: '/index?handler=RetData', headers: { Accept: "application/json; charset=utf-8" }, beforeSend: function (xhr) { xhr.overrideMimeType("application/json; charset=utf-8") }, data: AddAntiForgeryToken({ 'oldEmail': oldEmail }), dataType: "json", success: function (retValue) { alert(retValue); }, error: function (e) { var msg = "Error!" + e.message; alert(msg); } });
[HttpPost] [ValidateAntiForgeryToken] public JsonResult OnPostRetData([FromBody] JObject jobject) { try { JObject job = new JObject(); job.Add("Album", "Me Against The World"); return new JsonResult(job); } catch (Exception ex) { throw ex; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)