title: jquery ajax has a problem getting return value from ashx handler
body: <p>Greetings,</p>
  
  <p>No matter what I do I cannot get my jquery ajax code to get a response other than null from an ashx handler page.</p>
  
  <p>Here is my hmt page:</p>
  
  <pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
      &lt;title&gt;:: ashx tester ::&lt;/title&gt;
      &lt;link rel="stylesheet" href="js/jqueryui/1.8.6/themes/sunny/jquery-ui.css"
          type="text/css" media="all" /&gt;
      &lt;script type="text/javascript" src="js/jquery/1.4.3/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/jqueryui/1.8.6/jquery-ui.min.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/json2/0.0.0/json2.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          $(function () {
              $('#btnSubmit').click(
                  function () {
                      DoIt();
                  }
              );
          });
  
          function DoIt() {
              $('#btnSubmit').hide();
              $.ajax({
                  type: "POST",                
                  url: "http://localhost:49424/Handler1.ashx",
                  data: {
                      firstName: 'Bob',
                      lastName: 'Mahoney'
                  },
                  dataType: "json",
                  contentType: "application/json; charset=utf-8",
                  success: function (response) {
                      alert('success: ' + response);
                      $('#btnSubmit').show();
                  },
                  error: function (response) {
                      alert('error: ' + response);
                      $('#btnSubmit').show();
                  }
              });
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input id="btnSubmit" type="button" value="Submit" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And here is my ashx page:</p>
  
  <pre><code>Imports System.Web
  Imports System.Web.Services
  Imports System.Collections.Generic
  Imports System.Linq
  Imports System.Data
  Imports System.Configuration.ConfigurationManager
  Imports System.Web.Services.Protocols
  Imports System.Web.Script.Serialization
  
  Public Class Handler1
      Implements System.Web.IHttpHandler
  
      Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest
          Dim j As New System.Web.Script.Serialization.JavaScriptSerializer
          Dim s As String
  
          s = j.Serialize(Now)
          context.Response.ContentType = "application/json"
          context.Response.Write(s)
  
      End Sub
  
      ReadOnly Property IsReusable() As Boolean Implements IHttpHandler.IsReusable
          Get
              Return False
          End Get
      End Property
  
  End Class
  </code></pre>
  
  <p>Any clues?</p>
  
  <p>Thanks!</p>
  
  <p>Dave</p>