title: pass jquery json into asp.net httphandler
body: <p>Just don't get it what i'm doing wrong..
  i've been looking for dozens of similar questions, yet still got misunderstandings...
  when i call CallHandler function from JS, i always get 'Request Failed' alert.
  please help me.</p>
  
  <p>JS/Jquery:</p>
  
  <pre><code>function CallHandler() {
      $.ajax({
          url: "DemoHandler.ashx",
          contentType: "application/json; charset=utf-8",
          type: 'POST',
          dataType: "json",
          data: [{"id": "10000", "name": "bill"},{"id": "10005", "name": "paul"}],
          success: OnComplete,
          error: OnFail
      });
      return false;
  }
  
  function OnComplete(result) {
      alert(result);
  }
  function OnFail(result) {
      alert('Request Failed');
  }
  </code></pre>
  
  <p>asp.net c# code behind:</p>
  
  <pre><code>public void ProcessRequest(HttpContext context)
  {
    JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
    string jsonString = HttpContext.Current.Request.Form["json"];
  
    List&lt;Employee&gt; emplList = new List&lt;Employee&gt;();
    emplList = jsonSerializer.Deserialize&lt;List&lt;Employee&gt;&gt;(jsonString);
  
    string resp = "";
    foreach (Employee emp in emplList){
    resp += emp.name + " \\ ";
    }
    context.Response.Write(resp);
  }
  
  public class Employee
  {
    public string id { get; set; }
    public string name { get; set; }
  }
  </code></pre>