Json data from Server could not be parsed. This is caused by Json formatting error
Json data from Server could not be parsed. This is caused by Json formatting error
![jaspreetsingh](https://secure.gravatar.com/avatar/5f679e212e578ab9f844f60e8a8776a0/?default=https%3A%2F%2Fvanillicon.com%2F5f679e212e578ab9f844f60e8a8776a0_200.png&rating=g&size=120)
Hi Guys,
I am trying to achieve the server side processing below is the code: i am using asp.net Web Service method.
$(document).ready(function () {
$('#grid').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "Default.aspx/ServerSideTest",
aoColumns:
[
{ "sTitle": "EmpId" },
{ "sTitle": "EmpName" },
{ "sTitle": "Salary" }
]
});
});
Here ServerSideTest is the Web Method that returns the List of Employees
[WebMethod]
public static List ServerSideTest()
{
// this method returns List of employees
return list;
}
Please let me know how i can resolve the above issue.
Thanks
Jaspreet Singh
I am trying to achieve the server side processing below is the code: i am using asp.net Web Service method.
$(document).ready(function () {
$('#grid').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "Default.aspx/ServerSideTest",
aoColumns:
[
{ "sTitle": "EmpId" },
{ "sTitle": "EmpName" },
{ "sTitle": "Salary" }
]
});
});
Here ServerSideTest is the Web Method that returns the List of Employees
[WebMethod]
public static List ServerSideTest()
{
// this method returns List of employees
return list;
}
Please let me know how i can resolve the above issue.
Thanks
Jaspreet Singh
This discussion has been closed.
Replies
Actually i tried to debug in Firebug, it gives me error "Json Data from Server Could not be parsed" before it returns anything.
It's been almost a week i am trying to work on Jquery DataTable, I am only able to make it work with Javascript array, But as i have large database , it's taking long time to initialize table . So i am moving to use Server Side Processing like above.
Unfortunatly after so many tries and trying so many codes of asp.net and web services C#, i am not able to implemnt it :(.
Still i will try again to implement it. It would be great if someone can give me working simple example to make it work with asp.net and C# web services.
Thanks
Jaspreet Singh