Saving XmlDocument object to client computer as a file

  • Thread starter Thread starter Throne Software
  • Start date Start date
T

Throne Software

I am working on a ASP .Net page with a C# back end that displays, and
give the option to save, an XmlDocument object. While displaying the
XML in a literal was easy, I can't figure out how to allow the user to
save the XmlDocument as a file without creating an XML file on the
server. It is important that the XML file is not created server side.

Any insight to my problem would be most appreciated.
 
Stream the XML document to the user.

For example, you might create a specific .ASPX page that, in its Page_Load()
function, generates your XmlDocument in memory, and writes it to the
Response output stream.

Remember to set the correct content type!
 
Back
Top