I am using a Telerik MVC grid with Ajax binding and I have a problem with passing the object to the controller, which will be used to filter the data. I can pass simple data (string, int), but no more complex object.
For example, I can handle this:
.DataBinding(dataBinding => dataBinding.Ajax().Select("_CasesAjaxBinding", "Home", new {orderId = "12345"} ))
And then in my controller handle orderId as follows:
public ActionResult _CasesAjaxBinding(string orderId)
The problem I encountered is when I try to pass a more complex object (in this case @Model) to the controller, for example (@Model - type CaseFilterModel):
.DataBinding(dataBinding => dataBinding.Ajax().Select("_CasesAjaxBinding", "Home", new {filterSpec = @Model} ))
And then, trying to process the object, like this:
public ActionResult _CasesAjaxBinding(CaseFilterModel filterSpec)
The filterSpec parameter is always zero.
Thanks in advance for any ideas!
Mattw source
share