title: Jquery DataTable passing a parameter to ajax call asp.net. Invalid JSON primitive
body: <p>Below is my java script code to Populate my HTML table with server data and I am using Jquery DataTables to server this purpose.</p>
  
  <pre><code>function LoadData(result) {
  $('#example').DataTable({
  "ajax": {
     "dataType": 'json',
     "contentType": "application/json; charset=utf-8",
     "type": "POST",
     "url": "index.aspx/Risky",
     "data": function (d) {
      return JSON.stringify( d )
      //return JSON.stringify(result);
      // d.extra_search = result;      
      //"extra_search": result
  
     },
     "dataSrc": function (json) {
         return $.parseJSON(json.d);
     }
  },
  "columns": [
      { "data": "Prctice_Group_Risk_No" },
      { "data": "Practice_Group" },
      { "data": "Risk_Category" },
   ]
  });
  }
  </code></pre>
  
  <p>Below is my code behind web method description</p>
  
  <pre><code>[WebMethod]
  [ScriptMethod]
  public static string Risky()
  {
    return JsonConvert.SerializeObject(riskList);
  }
  </code></pre>
  
  <p>Until now its working fine, My web method gets called and my HTML table gets populated.</p>
  
  <p>But my problem is that I want to pass the variable "result" as parameter to this ajax call so that my web method receives it and returns me a specific data based over this parameter.</p>
  
  <p>I have visited <a href="https://datatables.net/reference/option/ajax.data" rel="nofollow">https://datatables.net/reference/option/ajax.data</a> and tried to follow all of the methods described there to pass the extra data with my ajax call as you can see in my java script code three commented lines of code,I have tried this three different ways but none of it works for me causing me to a single same problem, "<strong>Invalid JSON primitive</strong>" with a 500 server status code in my firebug debugger. I can see in my firebug debugger that the parameter being passed to the method is "extra_search=123"</p>
  
  <p>I can guess from the error description that my way of adding this extra parameter is not correct , e.g somehow it doesn't make a correct json format. but I don't know how to correct it. </p>
  
  <p>Anyone kindly help.  </p>