I'm trying to return an xml string from a IHttpHandler to a like this:
context.Response.Write(xml);
When I receive the response in my .aspx.cs I try to load the document as follows:
var xml = XDocument.Load(xmlString);
but I get an Illegal Characters in Path
error message.
I've also tried
context.Response.Write(context.Server.HtmlEncode(xml));
and
var xml = XDocument.Load(Server.HtmlDecode(xmlString));
but I get the same message. Is there any way I can return XML from my IHttpHandler?
replace this:
var xml = XDocument.Load(xmlString);
with this:
var xml = XDocument.Parse(xmlString);