title: AJAX Return Type from ASHX Handler
body: <p>I'm writing a page that needs to exchange some information with a SQL server. For portability reasons, and because I hate writing ASP but I've been told to do this on the IIS 7 server, I'm writing the page in pure HTML, a generic handler (ASHX) in C# .NET to do the server-side stuff, and using AJAX to communicate between them. I've got this approach working using <code>Response.ContentType = "text/plain";</code>, but I'd like to return several pieces of information with one request, so I'm switching to XML or JSON, leaning toward XML.</p>
  
  <p>So, to return XML, I change to <code>"text/xml"</code>, but then do I just <code>Response.Write</code> the whole XML code verbatim, or is there a more succinct way built into .NET? Same question for JSON. I know there are specific methods in jQuery (even just JavaScript) for parsing the returned data, so I was wondering if there was something similar in .NET to encode.</p>