I have the following code in a standard C# ASP.NET MVC controller.
public JsonResult ReadTeachers()
{
return Json(ReadTeacherData(), JsonRequestBehavior.
instead of using
public void UpdateTeachers(IEnumerable<Teacher> updatedTeachers)
{
// this is never called
}
used
public JsonResult UpdateTeachers(string models)
{
//Deserialize to object
IList<Teacher> teachers= new JavaScriptSerializer().Deserialize<IList<Teacher>>(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
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.