문제

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!)?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top