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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top