jQuery数据表搜索文本

时间:2019-04-11 16:34:07

标签: c# jquery asp.net-mvc datatable controller

如何在服务器端捕获带有参数的搜索文本。当我调试程序时,它始终为null。我看到了这个Request.Form.GetValues("search[value]")[0],但我想将其作为参数。有可能吗?

$('#datatableClients').DataTable({
        "processing": true, 
        "serverSide": true, 
        "filter": true, 
        "orderMulti": false, 
        "ajax": {
            "url": "/Custom/Data/GetRows",
            "type": "POST",
            "datatype": "json"
        },
        "columns": [
                { "data": "FirstName", "name": "First Name", "autoWidth": true },
                { "data": "LastName", "name": "Last Name", "autoWidth": true }

        ]
    });



public JsonResult GetRows(int draw, int start, int length, string search)
{ 
    // search parameter is null
}

0 个答案:

没有答案