title: Invalid web service call, missing value for parameter \u0027filters\u0027
body: <p>When I post my ajax data to my webservice I keep getting this error. I have tried many times and changed my code to return a json string back but it fails every time.All im trying to do is send back the data I have posted so I know it works. I have looked for answers and I have tried other alternatives but im not getting the results here is the error</p>
  
  <p>{"Message":"Invalid web service call, missing value for parameter: \u0027filters\u0027.","StackTrace":" at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary<code>2 parameters)\r\n at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary</code>2 parameters)\r\n at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}</p>
  
  <p>jquery:</p>
  
  <pre><code>data = [{'Name': 'Acer', 'Count': 1 }, {'Name': 'HP', 'Count': 2 }]
  function getProducts(json, pageIndex, pageSize) {
  
      $.ajax({
          type: 'POST',
          url: '/website2/WebServices/GetProducts.asmx/GetProductsAndFilters',
          data: "{'data' : {'filters':" + JSON.stringify(json) + ", 'PageIndex' : " + pageIndex + ", 'PageSize' : " + pageSize +  "}}",
          contentType: 'application/json; charset=utf-8',
          dataType: 'json',
          success: function (responseText) {
              //alert(responseText.d);
              $('.console').html(responseText.d);
          },
          error: function (xhr, status, error) {
              //var msg = JSON.parse(xhr.responseText);
              //alert(msg.Message);
              $('.console').html(xhr.responseText)
          }
      });
  }
  getProducts(data, "0", "2")
  </code></pre>
  
  <p>C#:</p>
  
  <pre><code>public class dvals
  {
      public string Name { get; set; }
      public string Count { get; set; }
  }
  
  public class data
  {
      public List&lt;dvals&gt; Filters {get;set;}
      public string PageIndex { get; set; }
      public string PageSize { get; set; }
  }
  
  [WebMethod]
  [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
  public data GetProductsAndFilters(data filters)
  {
      JavaScriptSerializer js = new JavaScriptSerializer();
      //List&lt;dvals&gt; json = js.Deserialize&lt;List&lt;dvals&gt;&gt;(filters);
      //data json = js.Deserialize&lt;data&gt;(filters);
      var fname = "";
      /*
      foreach (var filter in filters)
      {
          if (filter.Name == "Acer")
          {
              fname = filter.Name;
              break;
          }
  
      }*/
      return filters; 
  }
  </code></pre>