Question

I've been implementing a custom model binder to handle the data returned from the datatables.net jQuery plugin but am having trouble actually getting to the data as it is being passed back in the request body and my ModelBindingContext only seems to have a ValueProvider for the query string.

Currently my controller method signature looks like this:

[HttpPost]
public DataTablesResult GetTableData([ModelBinder(typeof(MyCustomModelBinder))] DataTablesInput input)

which is getting data from a simple $.post().

I've tried adding a FromBody attribute to the input parameter, but that seems to stop the custom model binder being called at all.

How do I get my model binder to recognise data in the request body, or if that's not possible, how do I move my posted data into the query string (I'd like to not do this!)?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top