No data available in table
No data available in table
Hello everyone.
I have a little difficulty in my first implementation using DataTable, I have already looked at some other forums, but I still have the problem.
I can't display any information in my table, which seems strange, knowing that my ajax request is correct.
I'm programming in ASP.NET C # and using ajax to make a request, my webmethod returns a json object. I did some tests using postman and apparently json is returning correctly.
I appreciate all possible help.
Follows images for better viewing
** Note: my json starts with "d", this is because I am using C # 3.5 or above, which by default serializes all JSON responses in a d variable.
Pictures:
My Ajax:

My WebMethod:

My Html Table:

Request made in postman:

Strong hug.
Replies
You are not providing the JSON data (
result) to Datatables. You will need to usedatato do this. Here is an example of using Javascript sourced data:https://datatables.net/examples/data_sources/js_array.html
For example:
You misspelled
destroy: true.The
dataSrcoption you have is only when you are using the Datatablesajaxoption. It isajax.dataSrc. You can remove it since its not a valid option.Kevin
Kevin,
I don't know how to thank you, thank you very much for your help, problem solved!