, . , - XmlDocument - (, ), , ( ).
Page :
xmldoc.Save(Response.OutputStream);
xmldoc.Save(Response.Output);
You can easily create an .ashx file and its associated code (the new "Common Handler" element), and then in the code that implements the IHttpHandlerimplementation ProcessRequestusing
public void ProcessRequest(HttpContext context)
{
XmlDocument doc = ...;
doc.Save(context.Response.OutputStream);
}
You can also set the appropriate type of content (possibly "text / xml", unless it matches a specific XML format that you want to interpret differently), etc. If you want the client to save it by default, you must set the content placement.
source
share