如何使用post请求将服务器端jquery数据表数据发送到服务器

Man*_*ngh 2 c# datatables

我正在使用服务器端jquery数据表,我在我的c#program中使用了简单的ajax get请求并访问了jquery数据表数据(如:start,draw,order,search).但是现在我有很多列,所以它不是所有数据表的数据使用get请求的列,所以我想使用ajax post请求,但我不知道如何访问这些数据表参数(开始,绘制,顺序,搜索)并在ajax post请求中传递这些参数.

GET请求: 客户端

 "ajax": "/Admin/InterestsJson"
Run Code Online (Sandbox Code Playgroud)

服务器端: C#

NameValueCollection nvc = HttpUtility.ParseQueryString(Request.Url.Query);
string sEcho = nvc["draw"];
int iDisplayStart = Convert.ToInt32(nvc["start"]);
string searchValue = nvc["search[value]"];
int orderColumn = Convert.ToInt32(nvc["order[0][column]"]);
string orderDir = nvc["order[0][dir]"];
Run Code Online (Sandbox Code Playgroud)

发布请求:客户端

"ajax": {
"url": "/Admin/SubInterestsJson",
"type": "POST"
}
Run Code Online (Sandbox Code Playgroud)

请告诉我如何访问这些jquet数据表参数并传入post请求?

Man*_*ngh 6

对于POST请求:

如果要发送POST请求,请在服务器端使用以下代码,如:

string sEcho = Request.Params["draw"];
int iDisplayStart = Convert.ToInt32(Request.Params["start"]);
string searchValue = Request.Params["search[value]"];
int orderColumn = Convert.ToInt32(Request.Params["order[0][column]"]);
string orderDir = Request.Params["order[0][dir]"];
Run Code Online (Sandbox Code Playgroud)

对于GET请求:

以下代码是我之前用于GET请求的代码.

NameValueCollection nvc = HttpUtility.ParseQueryString(Request.Url.Query);
string sEcho = nvc["draw"];
int iDisplayStart = Convert.ToInt32(nvc["start"]);
string searchValue = nvc["search[value]"];
int orderColumn = Convert.ToInt32(nvc["order[0][column]"]);
string orderDir = nvc["order[0][dir]"];
Run Code Online (Sandbox Code Playgroud)