ASP NET MVC JQUERY send ajax request and get results

var ooData = { GroupID: GroupID, OrgInn: orgINN, check_id: oOrganisationRisk.cell(this, 0).data() };
var jqxhr = $.post("/Home/ProtocolAjaxHandler", ooData, function (data) {
var ss = "";
$.each(data, function (i) {
  ss = ss + "<tr><td>" + this.description + "</td><td>" + this.date_check + "</td></tr>";
  });
$("#ProtocolTable").html(ss);


        [HttpPost]
        public ActionResult ProtocolAjaxHandler(ProtocolPost _param)
        {
            var riski = RiskiRepository.Show_Protocol(_param.OrgInn ?? "", _param.GroupID ?? 0, _param.check_id ?? 0);
            return Json(riski);
        }


        public class ProtocolPost
        {
            public string OrgInn {get;set;}
            public int? GroupID { get; set; }
            public int? check_id { get; set; }
        }




No comments:

Post a Comment