title: jQuery Ajax not calling webmethod after url rewriting
body: <p>My jQuery AJAX function is not calling my webmethod. Here is my code:</p>
  
  <pre><code>$.ajax({
      type: "POST",
      url: "Search.aspx/GetCustomers",
      data: '{pageIndex:' + pageIndex + ',searchText:"' + $('#HiddenField1').val() + '",SearchBy:"' + $('#ddlSelectProfile').val() + '"}',
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: OnSuccess,
      failure: function (response) {
          alert(response.d);
      },
      error: function (response) {
          alert(response.d);
      }
  });
  </code></pre>
  
  <pre class="lang-csharp prettyprint-override"><code>[WebMethod]
  public static string GetCustomers(int pageIndex, string searchText, string SearchBy)
  {
      return GetCustomersData(pageIndex,searchText, SearchBy ).GetXml();
  }
  </code></pre>
  
  <p>and in web.config</p>
  
  <pre><code>&lt;rewrite url="~/Search/(.+)-(.+).html" to="~/Search.aspx?MyTitleId=$1&amp;amp;page=$2" processing="stop" /&gt;
  </code></pre>