如何在服务器端捕获带有参数的搜索文本。当我调试程序时,它始终为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
}