title: How to return response to .aspx page from Handler in asp.net
body: <p>I've just start working with handlers in asp.net and I've got one question.
  I have PostRequestPage.aspx page with such structure:</p>
  
  <pre><code>&lt;asp:Label ID="lblTest" Text="Enter request" runat="server"&gt;&lt;/asp:Label&gt;
      &lt;br /&gt;
      &lt;asp:TextBox ID="txtEmail" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;br /&gt;
      &lt;span id="error"&gt;&lt;/span&gt;
      &lt;br /&gt;
      &lt;input type="button" id="btnSubmit" name="btnSubmit" value="Send" /&gt;
  </code></pre>
  
  <p>And I send my POST to handler using ajax post like this:</p>
  
  <pre><code>$(document).ready(function () {
              $('#btnSubmit').click(function() {
                  var txtEmail = '&lt;%=txtEmail.ClientID%&gt;';
                  $.ajax({
                      type: "POST",
                      url: "HandlerWithPOST.ashx",
                      data: $('#' + txtEmail).val(),                       
                      dataType:"json",                   
                  });
              });
          })
  </code></pre>
  
  <p>In handler I get my POST data:</p>
  
  <pre><code>using (var reader = new StreamReader(context.Request.InputStream))
                      {
   String requestFromPost = reader.ReadToEnd();
  var result = JsonConvert.DeserializeObject&lt;List&lt;RootObject&gt;&gt;(requestFromPost);
  }
  </code></pre>
  
  <p>Then I process my data and get the response I want to return to PostRequestPage.aspx page :</p>
  
  <pre><code>String jsonResult = JsonConvert.SerializeObject(new { result = results });
  </code></pre>
  
  <p>The question is how can I show my jsonResult in label,for example?</p>