I am creating an mvc.net project in which I have a jquery ajax request as follows
$.ajax({ url: "@Url.Action("getdata", "SeatPlans")", data: { seat_plane_id : 17}, type: "POST", dataType: "json", success: function (data) { loadData(data); }, error: function () { alert("Failed! Please try again."); } });
which trigger the next controller action
public JsonResult getdata(int seat_plane_id) { int lid = seat_plane_id; List<SeatPlans> allUser = new List<SeatPlans>(); allUser = db.SEATPLAN.Where(d => d.layout_id == lid).ToList(); lid++; List<SeatPlans> allUser1 = new List<SeatPlans>(); allUser1 = db.SEATPLAN.Where(d => d.layout_id == lid).ToList(); return new JsonResult { Data = allUser,JsonRequestBehavior = JsonRequestBehavior.AllowGet }; }
the code is working fine. the controller action sends data to allUser for the callback function.
but I need me to want to send both data to alluser and allUser1 to the success function of the ajax call
javascript c # ajax asp.net-mvc-4
rakshi
source share