数据表服务器端处理MVC核心与角度 [英] Datatables server side processing in MVC core with angular
问题描述
我可以知道,如何在 Asp.net MVC Core中进行服务器端DataTable处理(过滤,分页,排序)与Angular 。
我正在尝试好几天,但无法成功。
任何帮助/教程/指导都将不胜感激。
感谢您的时间。
我尝试了什么:
我在下面尝试过:
我无法在Controller中获得以下参数。
Hi,
May i please know, how can i do server side DataTable processing(filtering,paging,sorting) in Asp.net MVC Core with Angular.
I am trying for several days, but unable to succeed.
Any help/tutorial/guidance will be appreciated.
Thanks for your time.
What I have tried:
I have tried below:
I am not able to get below parameters in Controller.
<pre>var draw = Request.Form.GetValues("draw").FirstOrDefault();
var start = Request.Form.GetValues("start").FirstOrDefault();
获取错误:IFormCollection不包含GetValues()的定义。
以下链接也尝试过帮助,已经:
数据表gularJS和asp.net mvc | DotNet - 太棒了 [ ^ ]
推荐答案
如错误所示,Request.Form
不包含一个名为GetValues
的方法。
IFormCollection接口(Microsoft.AspNetCore.Http)| Microsoft Docs [ ^ ]
从表单中读取值非常简单:
As the error says,Request.Form
does not contain a method calledGetValues
.
IFormCollection Interface (Microsoft.AspNetCore.Http) | Microsoft Docs[^]
Reading a value from the form is as simple as:
var draw = Request.Form["draw"];
或者,您可以使用模型绑定为您提取值,或者您可以使用现有库来简化生活:
GitHub - ALMMa / datatables.aspnet:Microsoft Asp.Net服务器端支持和jQuery DataTables帮助程序 [ ^ ]
这篇关于数据表服务器端处理MVC核心与角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!