Saving Downloaded Xml from ASPX page as File

From: Christopher D. Wiederspan (wiederspan_at_reachdigital.com)
Date: 09/09/04


Date: Thu, 9 Sep 2004 07:34:14 -0600

I've got an ASPX page that simply builds an Xml document and does a
Response.Write back to the client with that Xml, something like this:

// Get the content as the Xml contained within the current working model
string content = someDataSet.GetXml();

// Write the response back to the user's stream
this.Response.Clear();
this.Response.ContentType = "text/xml";
this.Response.Write(content);
this.Response.End();

Right now, this causes IE to just display the data in it's typical Xml
incarnation - it's default behavior. My intention is that the user will
recieve the Save As... dialog box and can save this Xml to a file on their
machine instead of actually having to view it and manually use the browsers
Save As... menu item from the File menu. Part of the problem is that this
Xml file is produced via a local Intranet and is fairly large (say 10 MB).
When IE tries to actually parse and display the Xml, it takes forever.

I'm wondering if there is some other ContentType value that might cause the
trigger the Save As dialog immediately...?

Any ideas would be greatly appreciated.

Thanks,
Chris



Relevant Pages

  • Re: TreeView Dynamic XML Binding
    ... Subject: TreeView Dynamic XML Binding ... Expand the ReturnHeader node. ... When I click on the tree node for the select ... I'm simply trying to display the xml element tree ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • What is XML for Motif resource files + xnllanguage?
    ... I have used resource files and xnlLanguage to control the language ... application would be able to display the content in that language. ... Regarding XML I have found info about i18n in several places including ...
    (comp.text.xml)
  • Newbie: Best layout for XML file?
    ... I have a database that I would like to add XML exporting to, ... able to display that information "EASILY" on a web page. ... The supplies and notes fields may have any number of text lines, ... Go to store, and buy supplies. ...
    (comp.text.xml)
  • Re: Stupid CSS question
    ... but that is the point of display. ... Apples developer docs are just docbook stuff that is processed to ... XML, docbook format. ...
    (uk.comp.sys.mac)
  • Using XML & ASP.NET (or what do I *need* to know?)
    ... Initially, it will be enough for the client to display the data from the service, but eventually, I'll have to write a client that will allow for modification of the data and return it to the service. ... I gather from bits and pieces that I'm reading that I can convert the data into an XML document and it is this document which is sent to the client over an HTTP connection. ... I've been fooling around with XmlSerializer, since that seems as if it will convert the class instances to formatted XML. ...
    (microsoft.public.dotnet.xml)