我已经让 Kendo Grid 调用 MVC 动作,但是我在动作中的断点没有被击中,也没有返回任何内容。任何想法为什么?
JavaScript:
$("#grid").kendoGrid({
dataSource: {
type: "json",
transport: {
read: {
url: "Sales/GetSalesHistory",
dataType: "json",
type: "GET",
data: { id: "@ViewBag.CustomerEstimateKey" }
}
},
schema: {
data: "data",
total: "total"
}
}
});
行动:
[HttpGet]
public JsonResult GetSalesHistory(int id)
{
List<Sales> sales = PestsLogic.GetSalesById(id);
return Json(new { data = sales, total = sales.Count }, JsonRequestBehavior.AllowGet);
}