title: Jquery DataTable issue On ServerSide Processing
body: <p>My scripts are Here:</p>
  
  <pre><code> &lt;link href="~/Content/jquery.dataTables.min.css" rel="stylesheet" /&gt;
    &lt;script src="~/Scripts/jquery.dataTables.min.js"&gt;&lt;/script&gt;   
  </code></pre>
  
  <p>My Jquery Code is Here:     </p>
  
  <pre><code>$("#myTable").DataTable({
                  "processing": true, // for show progress bar
                  "serverSide": true, // for process server side
                  "filter": true, // this is for disable filter (search box)
                  "aaSorting": [[2, 'asc']],
                  //"width":540,
                  "pagingType": "full_numbers",
                  scrollY: 265,
                  "lengthChange": false,
                  "oLanguage": {
                      "sUrl": "media/language/de_DE.txt",
                      "sZeroRecords": "There are no records that match your search criterion",
                      "sLengthMenu": "Display _MENU_ records per page",
                      "sInfo": "Displaying _START_ to _END_ of _TOTAL_ records",
                      "sInfoEmpty": "Showing 0 to 0 of 0 records",
                      "sInfoFiltered": "(filtered from _MAX_ total records)"
                  },
                  "ajax": {
                      "url": "/Home/LoadData",
                      "type": "POST",
                      "datatype": "json",
  
                      "dataFilter": function(data){
                     var json = jQuery.parseJSON( data );
                     json.recordsTotal = json.recordsTotal
                     json.recordsFiltered = json.recordsFiltered;
                     json.data = json.data;
                     return JSON.stringify( json ); 
                    }
  
                  },
                  "columns": [
  
                       {
                           "data": " ", "autoWidth": true, 'sortable': false, "mRender":
                            function (value, AddedOn, mData, type, row) {
                                      return '&lt;input type="checkbox" name="employeeIdsToDelete" id="' + mData.ID + '" class="call-checkbox" value="' + mData.ID + '" /&gt;';
                                                                         }
                       },
  
                       {
                            "data": "Station", "name": "Station", "autoWidth": true, 'render':
                             function (Station, mData, type, row) {
                                       return "&lt;a href='/Home/EditEmployee?id=" + type.ID + "' id='modal1' &gt;"+ type.Station +"&lt;/a&gt;";
                                                                   }
                        },
                        {
                            "data": "FlightNo", "name": "Flight No.", "autoWidth": true, 'render':
                              function (FlightNo, mData, type, row) {
                                  return "&lt;a href='/Home/EditEmployee?id=" + type.ID + "' id='modal1' &gt;" + type.FlightNo + "&lt;/a&gt;";
                                                                     }
                          },
                          {
                              "data": "FlightDate", "name": "FlightDate", "autoWidth": true, "type": "date", "render":
                                function (value, FlightDate, mData, type, row) {
                                  if (value === null) return "";
                                  var pattern = /Date\(([^)]+)\)/;
                                  var results = pattern.exec(value);
                                  var dt = new Date(parseFloat(results[1]));
                                  //var d = new Date();
                                  var MonthIndex = dt.getMonth();
                                  var monthnames = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
                                  var imonth = monthnames[MonthIndex];
  
                                  return "&lt;a href='/Home/EditEmployee?id=" + mData.ID + "' id='modal1' &gt;" + dt.getDate() + " " + imonth + " " + dt.getFullYear() + "&lt;/a&gt;";
                                                                                  }
                          },
                          {
                              "data": "PaxNo", "name": "No. of Pax", "autoWidth": true, 'render':
                                function (No_Of_Passengers, mData, type, row) {
                                  return "&lt;a href='/Home/EditEmployee?id=" + type.ID + "' id='modal1' &gt;" + type.No_Of_Passengers + "&lt;/a&gt;";
                                                                               }
                          },
                          {
                              "data": "StatusDescription", "name": "Status", "autoWidth": true, 'render':
                                function (StatusDescription, mData, type, row) {
                                    return "&lt;a href='/Home/EditEmployee?id=" + type.ID + "' id='modal1' &gt;" + type.StatusDescription + "&lt;/a&gt;";
                                                                               }
                          },
                          {
                              "data": "TextMsg", "name": "LDM", "autoWidth": true, 'render': function (TextMsg, mData, type, row) {
  
  
                                  return "&lt;a href='/Home/EditEmployee?id=" + type.ID + "'id='modal1' &gt;" + type.TextMsg + "&lt;/a&gt;";
                              }
                          },
                          {
                              "data": "AddedOn", "name": "AddedOn", "autoWidth": true, "type": "date",
  
  
                              "render": function (value, AddedOn, mData, type, row) {
                                  if (value === null) return "";
                                  var pattern = /Date\(([^)]+)\)/;
                                  var results = pattern.exec(value);
                                  var dt = new Date(parseFloat(results[1]));
                                  //var d = new Date();
                                  var MonthIndex = dt.getMonth();
                                  var monthnames = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
                                  var imonth = monthnames[MonthIndex];
  
                                  return "&lt;a href='/Home/EditEmployee?id=" + mData.ID + "' id='modal1' &gt;" + dt.getDate() + " " + imonth + " " + dt.getFullYear() + "&lt;/a&gt;";
                                  //return (dt.getDate() + " " + imonth + " " + dt.getFullYear());
                              }
                          },
                          {
                              "data": " ", "autoWidth": true, 'sortable': false,
  
  
                      "mRender": function (value, AddedOn, mData, type, row) {
  
                          if (mData.StatusDescription == "Tkt. info. missing")
                          {
                              return "&lt;a href='/Home/Ticket?id=" + mData.ID + "' id='modal2' class='btn btn-primary btn' style='background-color:rgb(255,95,1);border-color:rgb(255,95,1);color:white;' &gt;Miss Tkts&lt;/a&gt;";
                          }
                          else {
                              return "Completed";
                          }
  
                      }
                  },
                           {
                               "data": " ", "autoWidth": true, 'sortable': false,
  
  
                               "mRender": function (value, AddedOn, mData, type, row) { return '&lt;button class="btn btn-primary btn" style="background-color:rgb(255,95,1);border-color:rgb(255,95,1);color:white;" type="submit" name="Command" value="' + mData.ID + '" &gt; Preview &lt;/button&gt;'; }
                           }
                  ]
              });
  </code></pre>
  
  <p>And My Controlller Code is Here:</p>
  
  <pre><code>  [HttpPost]
          public ActionResult LoadData()
          {
              cnUCR cn = new cnUCR();
              IEnumerable&lt;usp_FlightsStatusGrid_Result&gt; flightinfo;
              int suserid = Convert.ToInt32(Session["ID"]);
              flightinfo = cn.usp_FlightsStatusGrid(suserid).Where(x =&gt; x.StatusID == 5).ToList();
              var idFilter = Convert.ToString(Request["txtStation"]);
             // var StationName = Request.Form.GetValues("columns[0][search][value]").FirstOrDefault();
             // var FlightNo = Request.Form.GetValues("columns[1][search][value]").FirstOrDefault();
              var istatus = Request.Form.GetValues("columns[2][search][value]").FirstOrDefault();
             // var Flightdate = Request.Form.GetValues("columns[3][search][value]").FirstOrDefault();
              var draw = Request.Form.GetValues("draw").FirstOrDefault();
              var start = Request.Form.GetValues("start").FirstOrDefault();
              var length = Request.Form.GetValues("length").FirstOrDefault();
              var sortColumn = Request.Form.GetValues("columns[" + Request.Form.GetValues("order[0][column]").FirstOrDefault() + "][name]").FirstOrDefault();
              var sortColumnDir = Request.Form.GetValues("order[0][dir]").FirstOrDefault();
              //var contactName = Request.Form.GetValues("columns[0][search][value]").FirstOrDefault();
              int pageSize = length != null ? Convert.ToInt32(length) : 0;
              int skip = start != null ? Convert.ToInt32(start) : 0;
              int recordsTotal = 0;
               recordsTotal = flightinfo.Count();
                  var data = flightinfo.Skip(skip).Take(pageSize).ToList();
                  return Json(new { draw = draw, recordsFiltered = recordsTotal, recordsTotal = recordsTotal, data = data }, JsonRequestBehavior.AllowGet);
              }
          }
  </code></pre>
  
  <p>When we run this project MY data not load into table and give me a alert message 
  alert message is Here:
  DataTables Warning: table id = mytable: Ajax errror. For more information about this error, please see:<a href="http://datatales.net/tn/7" rel="nofollow noreferrer">http://datatales.net/tn/7</a>
  Locally its working good but serverside it gives this error</p>