Re: Saving Downloaded Xml from ASPX page as File
From: Christopher D. Wiederspan (wiederspan_at_reachdigital.com)
Date: 09/09/04
- Next message: Scott Simons: "Re: is there a way to hide the query string?"
- Previous message: Fek: "ASP .NET, Thread Pool, machine.config"
- In reply to: Christopher D. Wiederspan: "Saving Downloaded Xml from ASPX page as File"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 9 Sep 2004 08:05:45 -0600
Got it! After further investigation, I stumbled across the
Content-Disposition header that you can set to force the Save As dialog box.
Worked like a charm.
Chris
"Christopher D. Wiederspan" <wiederspan@reachdigital.com> wrote in message
news:u0FszGnlEHA.2504@TK2MSFTNGP14.phx.gbl...
> 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
>
>
>
- Next message: Scott Simons: "Re: is there a way to hide the query string?"
- Previous message: Fek: "ASP .NET, Thread Pool, machine.config"
- In reply to: Christopher D. Wiederspan: "Saving Downloaded Xml from ASPX page as File"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|