aData is undefined

aData is undefined

nagdatatablesnagdatatables Posts: 2Questions: 0Answers: 0
edited September 2011 in General
I am new to DataTables. I am getting the error while implementing the DataTables in asp.net .
The error is : "aData is undefined" in "jquery.dataTables.js" plz give me the solution.

Thanks in advance.

Replies

  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    Can you provide more info? a link? screenshots? code?
  • nagdatatablesnagdatatables Posts: 2Questions: 0Answers: 0
    Thanks for the response.

    Here is my Aspx code :



    @import "css/demo_page.css"; @import "/media/css/header.ccss";
    @import "css/demo_table.css";








    $(document).ready(function () {
    $('#tbl').dataTable({
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "ProcessAsyncCalls.aspx/GetEmployees",
    "fnServerData": function (sUrl, aoData, fnCallback) {
    $.ajax({
    "type": "POST",
    "url": sUrl,
    "data":"{}",
    "success": fnCallback,
    "dataType": "json",
    "contentType": "application/json; charset=utf-8",
    "cache": false
    });
    }
    });
    });








    ID
    Name
    Location





    Loading data from server








    The error shows in "jquery.dataTables.js" file


    The below Webmethod is in ProcessAsyncCalls.aspx page

    [WebMethod]
    public static string GetEmployees()
    {
    var employee = new Employee();
    var dataTable = employee.GetEmployees();
    //var res = dataTable.ReadXml("ss").ToString();
    return JsonMethods.GetJsonString(dataTable);
    // return res;
    }
  • fbasfbas Posts: 1,094Questions: 4Answers: 0
    [quote]nagdatatables said: "data":"{}",[/quote]

    what's the purpose of this?

    and what is the return string/json?
  • little_heroinelittle_heroine Posts: 6Questions: 0Answers: 0
    i got the same problem. and cannot resolve it yet
This discussion has been closed.