Hi..
I have a web application(ASP.NET 2.0, C#), in which I am exporting a xml file.
The web page has a button called Export. When the user clicks the Export button, the File Download pops up, in which it has the Open,Save and Cancel Butons as in a normal file download pop-up. Being an xml file, the page also opens up,without the content behind the File download pop-up,
When the user clicks Cancel button, the file download pop up is gone, but the xml page(without the contents) is still open. This also happens when the user has successfully downloaded the xml file(Xml page is open)
Is it possible to close the xml page after the user clicks the cancel button and after the user saves the xml file? I am using Internet Explorer 6, Windows xp, SP1.
Please help.. Thanks
Thank you very much for the Reply.
This is the code i have used:
Response.AddHeader(
Response.ContentType =
Response.Write(StrategyXml);
Response.Flush();
Response.SuppressContent =
How to check the mime type and then close the xml page, during the cancel button click of the download pop-up and after saving the xml file?
Please help.
"Content-Disposition", "attachment; filename=" + StrategyName + ".xml");"application/xml";true;What you need to do is to prevent the XML file from opening in the window in the first place. The way to do that is most likely by changing the mime type to one that's handled better by Internet Explorer. Try changing the mime type from application/xml to text/xml and note if there are any changes. Also try using application/octet-stream.