Click here to Skip to main content
15,890,982 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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();


Getting error: IFormCollection does not contain definition for GetValues().

Tried help from below link as well, already:
Datatables in AngularJS and asp.net mvc | DotNet - awesome[^]
Posted
Updated 12-Jun-18 6:54am

1 solution

As the error says, Request.Form does not contain a method called GetValues.
IFormCollection Interface (Microsoft.AspNetCore.Http) | Microsoft Docs[^]

Reading a value from the form is as simple as:
var draw = Request.Form["draw"];

Alternatively, you can use model binding to extract the values for you, or you could use an existing library to make life easier:
GitHub - ALMMa/datatables.aspnet: Microsoft Asp.Net server-side support and helpers for jQuery DataTables[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900