Retrieve all sSearch values at once on server side

Retrieve all sSearch values at once on server side

MaidenRaingerMaidenRainger Posts: 1Questions: 1Answers: 0

Hello,

I have a question that sounds quite basic, but I've been searching for hours and hours on the Internet and I haven't found anything.

I have a Datatable initialised wih serverside = true. I want to be able to perform a search on a particular column.

I can see that the parameter sSearch_x (x being my column index) is correctly sent to the server. I'm able to retrieve it on my server with Request.QueryString["sSearch_x"] (.Net).

I was just wondering if there was a way to retrieve all params at once? Like automatically binding a model instead of performing a Request.QueryString for every param, which can be a pain?

I tried with this model:

public class DataTableParamModel
    {    
        public string sEcho { get; set; }
        public List<string> sSearch { get; set; }
        public int iDisplayLength { get; set; }
        public int iDisplayStart { get; set; }
        public int iColumns { get; set; }
        public int iSortingCols { get; set; }
        public string sColumns { get; set; }
    }

All the parameters that have exactly the same name (global parameters like iColumns, iDisplayLength) are correctly inserted into the model. Unfortunately, it doesn't work with column parameters.

Would you know a way to achieve this?

Sorry for any english mistakes and let me know if the question is not clear enough.

Thanks in advance.

This discussion has been closed.