Total Pageviews

Tuesday, 10 January 2012

How to Save/Download Xml File to local machine.


  XmlDocument doc = new XmlDocument();
  doc.LoadXml(XmlString);
           
  Response.ContentType = "text/plain"; // not text/xml
  Response.AppendHeader("Content-Disposition", "attachment; filename=test.xml");
  doc.Save(Response.OutputStream);
  Response.End(); //must it

No comments:

Post a Comment