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

jaspreetsinghjaspreetsingh Posts: 13Questions: 0Answers: 0
edited June 2012 in General
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

Replies

  • jaspreetsinghjaspreetsingh Posts: 13Questions: 0Answers: 0
    Can somebody please help???
  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    What does the JSON return look like?
  • jaspreetsinghjaspreetsingh Posts: 13Questions: 0Answers: 0
    Hi Allan,

    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
This discussion has been closed.