I’m trying to add new rows into a Kendo UI grid using a the popup editable property. Everything works fine, every added row appears in the grid. The problem is that the Create action method doesn’t exist. Firebug says:
A public action method 'Create' was not found on controller 'test.Controllers.IdeaController'.
However, the action method exists in the controller.
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create([DataSourceRequest] DataSourceRequest request,Idea product)
{
using (var db = new test_mockEntities1())
{
if (product != null && ModelState.IsValid)
{
db.Ideas.Add(product);
db.SaveChanges();
}
}
return Json(new[] { product }.ToDataSourceResult(request, ModelState));
}
What am I doing wrong?
Edit: as suggested by @jesper I updated the question with the action I’m trying to call.
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create([DataSourceRequest] DataSourceRequest request, Idea product)
{
using (var db = new migros_mockEntities1())
{
if (product != null && ModelState.IsValid)
{
db.Ideas.Add(product);
db.SaveChanges();
}
}
return Json(new[] { product }.ToDataSourceResult(request, ModelState));
}
The solution is quite simple. I wasn’t using kendo.aspnetmvc.js which made Kendo UI use GET instead of POST.