Trying to execute a LINQ query to populate an AJAX list, which will then be used in a DataTable within my View.
This was previously working without any issues when I wasn't using AJAX. The data was directly placed in the model and each row was rendered in a loop. However, this method was very resource-intensive and resulted in slow rendering times for larger queries.
Switching to AJAX, the LINQ query started returning NULL. I have confirmed that data retrieval works fine by implementing a test case with a small sample of AJAX. Nevertheless, the data table does not get populated for some reason.
In short, what I need: Fix the LINQ to List conversion and use it to fill the DataTable.
Below is the controller code:
(controller code here)
And here is the JavaScript code in the View:
(JavaScript code here)
and here is the DataTable section in the View:
(DataTable code here)
Some functions that are not essential for understanding have been omitted.
Thank you for your assistance.
EDIT: Another important point is that the success or failure functions of my datatable are not being executed.
EDIT: I removed the ViewData implementation, and now everything works (tested in POSTMAN)! However, when trying to fetch all data, it exceeds the maximum JSON limit: 2147483644.
Attempting a smaller query, which displays correctly in POSTMAN but doesn't show up in the table, resulting in an error:
http://localhost:51326/Table/Index?draw=1&columns%5B0%5D%5Bdata%5D=0&column…art=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1480633376897 Failed to load resource: the server responded with a status of 404 (Not Found)
Currently working on resolving this issue.