Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle search parameter in Datatables

I have the following code :

Controller method

public JsonResult GetNonstandardProgram(
    int draw, 
    int start, 
    int length, 
    string search = null /* or string search or string[] search = null */
    )

Posted data by datatables

...&search%5Bvalue%5D=somethingToSearch&search%5Bregex%5D=false

and I dont know how to handle this part

&search[value]=somethingToSearch

because in Controller passed string parameter 'search' is allways null.

What am I doing wrong ?

like image 805
Muflix Avatar asked May 24 '26 06:05

Muflix


1 Answers

I figured it out, solution is to use

[Bind(Prefix = "search[value]")] string search

as parameter input

like image 64
Muflix Avatar answered May 30 '26 03:05

Muflix