Why doesn't my KendoGrid call my MVC controller?

后端 未结 2 1724
礼貌的吻别
礼貌的吻别 2021-01-16 01:48

I have the following code in a standard C# ASP.NET MVC controller.

public JsonResult ReadTeachers()
{
    return Json(ReadTeacherData(), JsonRequestBehavior.         


        
2条回答
  •  粉色の甜心
    2021-01-16 02:46

    I had the same issue. I kept rechecking my grid thinking I had made a mistake there. It turned out that my problem was in the object I was passing into the grid: my object's Id was not set when it was passed in.

    I checked in Fiddler, and the POST was still being made, but without the object's ID my controller didn't recognize the parameters, thus not hitting my action.

    Make sure the objects returned by your read action have their properties set.

提交回复
热议问题