I need to pass parameter with grid to controller just i want to pass
BusId , FlightId , griddata to controller
this funtion send only griddata i want to add BusId , FlightId to save it in one table
function SaveData(e) {
var List = []
BusId: $("#BusId").val() form DropdownList (1) cascadeDrop
FlightId: $("#Flights").val() form DropdownList (2) cascadeDrop
var griddata = $("#Grid").data("kendoGrid"); From Selected Grid
var rows = griddata.select(); which i selected form grid
rows.each(function (e) {
var dataItem = griddata.dataItem(this);
List.push(dataItem);
});
$.ajax({
type: "POST",
url: "@Url.Action("Create", "Employee")",
dataType: "text",
data: JSON.stringify(List),
contentType: "application/json; charset=utf-8",
processData: false,
success: function (data) {
},
error: function (e) {
}
viewModel
public class EmpViewModel
{
public int BusId{ get; set; }
public int FlightId{ get; set; }
public List<Employee>AllEmployee{ get; set; }
}
Controller
public IActionResult Create([FromBody] IEnumerable<Employee> empList)
{
}
Any help please