Why doesn't my KendoGrid call my MVC controller?

后端 未结 2 1727
礼貌的吻别
礼貌的吻别 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:35

    instead of using

    public void UpdateTeachers(IEnumerable updatedTeachers)
    {
        // this is never called
    }
    

    used

    public JsonResult UpdateTeachers(string models)
    {
    //Deserialize to object
    IList teachers= new JavaScriptSerializer().Deserialize>(models);
    
    return Json(Teacher)
    }
    

    Note that parameterMap: function() send updated data in serialize string format with name models so you should use "models" as parameter name in your action

    i hope this will help you

提交回复
热议问题