title: jQuery: return string response in jquery ajax json call
body: <p>I am passing json data to my generic handler page <code>GenericHandler.ashx.cs</code> using jquery ajax request and json as data type.</p>
  
  <p>in my handler code i would like to return html table in string format. here is snap of my handler code</p>
  
  <pre><code>context.Response.ContentType = "text/plain";      
  context.Response.Write(sResponse);
  </code></pre>
  
  <p>where sResponse contains <code>&lt;table&gt;&lt;tr&gt;&lt;td&gt;PropertyName&lt;/td&gt;&lt;td&gt;PropertyID&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;abc&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</code></p>
  
  <p>my jquery code (<em>check inline comment in error function</em>):</p>
  
  <pre><code>  id = { 'PropertyID': id };
      $.ajax("Handlers/GenericHandler.ashx?Type=getProperties",
      {
          type: 'post',
          dataType: 'json',
          cache: false,
          contentType: "application/json",
          data: JSON.stringify(id),
          success: function (data) {
              console.log(data);            
          },
          error: function (xhr, status) {
              console.log(status); // Output as parseError
              console.log(xhr.responseText); // My sResponse string ! But Why Here ?
          }
      });
  </code></pre>
  
  <p><strong>My Question :</strong></p>
  
  <ol>
  <li>Why i am not getting response in success function</li>
  <li>Is it right way to do ? or should i convert html table to json object and then return it. And again display it in tabular format ?</li>
  </ol>