This is a migrated thread and some comments may be shown as answers.

Json model binder for DataSourceRequest

2 Answers 351 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Henry
Top achievements
Rank 1
Henry asked on 24 May 2016, 07:18 AM

Hi,

I'm trying to pass in DataSourceRequest instance to a web api method (POST), and can't find the model binder for it.

Here's my scenario in short:

1) Kendo Grid uses MVC controller action to get the data, and DataSourceRequest is binded ok.

2) In turn, the MVC action needs to call a web api url (using post), and include the DataSourceRequest as content (json format)

 

I checked this article: http://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/web-api-server-operations

But it only discusses the GET request, and when grid is directly calling web api.

 

Is there a json model binder for DataSourceRequest, for web api?

2 Answers, 1 is accepted

Sort by
0
Henry
Top achievements
Rank 1
answered on 25 May 2016, 12:00 PM

FYI, I was able to do this with a custom model binder (using Json.net serialize / deserialize).

Still, would be nice to know if there's an 'official' way to do it?

0
Vladimir Iliev
Telerik team
answered on 26 May 2016, 07:47 AM
Hello Henry,

There is no build-in way to do this and you should use custom code to achieve the desired behavior (as you already did).

Regards,
Vladimir Iliev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Henry
Top achievements
Rank 1
Answers by
Henry
Top achievements
Rank 1
Vladimir Iliev
Telerik team
Share this question
or