sAjaxSource with aspx
sAjaxSource with aspx
Hello,
I have a simple .aspx page to generate the json:
[code]
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim str As String = "{""" + "aaData" + """: [[""" + "TEST_1" + """]]}"
Response.Write(str.ToString())
End Sub
[/code]
The result of this is the follow "string": {"aaData": [["TEST_1"]]}
I validated this string and is ok.
But when i call this in js code I get the error: "DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error."
The js code
[code]
$(document).ready(function() {
$('#example').dataTable({
"sScrollY": "200px",
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "json.aspx"
});
});
[/code]
What this mean ?
Thanks and sorry for the poor English.
I have a simple .aspx page to generate the json:
[code]
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim str As String = "{""" + "aaData" + """: [[""" + "TEST_1" + """]]}"
Response.Write(str.ToString())
End Sub
[/code]
The result of this is the follow "string": {"aaData": [["TEST_1"]]}
I validated this string and is ok.
But when i call this in js code I get the error: "DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error."
The js code
[code]
$(document).ready(function() {
$('#example').dataTable({
"sScrollY": "200px",
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "json.aspx"
});
});
[/code]
What this mean ?
Thanks and sorry for the poor English.
This discussion has been closed.
Replies
It's probably because your JSON string does not contain basical informations for datatables. Did you read the usage page?
http://datatables.net/usage/server-side
Echo is sent by datatables request, you just have to send it back. The other numbers are about your data.