I have a small problem with a Ajax API request. I implemented a Controller like this, which takes ajax requests from Bootgrid:
public JsonResult PostThings(int current, int rowCount, string searchPhrase, KeyValuePair<string, string> sort )
The frist three parameters are bound but "sort" is not. The problem is, that the parameter is dynamic, which means that the field name is included in brakets. It is in the form of sort[field_name]=asc
.
I thought KeyValuePair<string,string>
could work, but it does not just as string[] sort
or just string sort
.
Is there a way to bind this parameter? I also have no idea how to write a custom model binder for that purpose.
Thanks for any hints.
Marco