Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8204669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:58:03+00:00 2026-06-07T07:58:03+00:00

I am trying to use JQuery Datatable plugin in ASP.NET MVC application. However, although

  • 0

I am trying to use JQuery Datatable plugin in ASP.NET MVC application. However, although my controller returns JSON data to plugin, the table shows a Loading... message and stuck there.

This is my controller,

public ActionResult GetCompanies(jQueryDataTableParamModel param)
{
   return Json(new
   {
       sEcho = param.sEcho,
       iTotalRecords = 97,
       iTotalDisplayRecords = 3,
       aaData = new List<string[]>() {
           new string[] {"1", "a1", "a2", "a3"},
           new string[] {"2", "b1", "b2", "b3"},
           new string[] {"3", "c1", "c2", "c3"}
           }
       }, JsonRequestBehavior.AllowGet);     
}

This is the initialization of datatable plugin.

$('#companyDataTable').dataTable({
    bProcessing: true,
    sAjaxSource: '@Url.Action("GetCompanies", "Company")'
});

This is the screenshot of my table.

enter image description here

This is the JSON data returned to plugin from Company/GetCompanies

{ "sEcho":null,
  "iTotalRecords":97,
  "iTotalDisplayRecords":3,
  "aaData":[ ["1","a1","a2","a3"],
             ["2","b1","b2","b3"],
             ["3","c1","c2","c3"]
           ]
}

jQuerDataTableParamModel is a class which is shown here. I also tried answers on this question but none of them are working for me.

EDIT :

This is how plugin request looks like.

enter image description here

Any ideas ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:58:04+00:00Added an answer on June 7, 2026 at 7:58 am

    You need to return the same sEcho value that your request had. In your response, “sEcho” value is null, so DataTables cannot connect request with response.

    From DataTables documentation:

    sEcho An unaltered copy of sEcho sent from the client side. This parameter will change with each draw (it is basically a draw count) –
    so it is important that this is implemented. Note that it strongly
    recommended for security reasons that you ‘cast’ this parameter to an
    integer in order to prevent Cross Site Scripting (XSS) attacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jQuery to get data from an ASP.NET web service (SharePoint
I'm trying to use jQuery UI tabs much like a Master Page in ASP.Net.
I am trying to use JQuery in my ASP.Net 2.0 website in this scenario:
I am trying to use jquery autocomplete plugin in my application. It works well
I'm trying to use jQuery.scrollTo plugin with accordion (where one block expands after clicking
I am trying to use jquery autocomplete plugin, I want it to suggest ItemCodes
I am using the datatables jquery plugin. I am trying to use it as
I am trying to implement a function on jquery datatable, that returns the 1st
Trying to use JQuery Easing plugin in my wordpress but its giving me following
I'm trying to use jQuery with the Validate plugin, except I cannot get my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.