473,480 Members | 2,840 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Download Dialog Appears Twice

I have an ASP page to download a CSV file using the following code

Response.ContentType="text/plain
Response.AddHeader "Content-disposition", "attachment; filename=Report.csv
Response.Write strCS

When I run this, I get the download dialog displayed twice. Any ideas how to solve this

Thank

Jul 19 '05 #1
2 1897
Really weird. I would start by tring just those lines :

<%
Response.AddHeader "Content-disposition", "attachment; filename=Report.txt"
Response.Write "Hello World !"
%>

Do you have the download dialog twice ? Does it open notepad twice ?

Patrice

"BillH" <an*******@discussions.microsoft.com> a écrit dans le message de
news:69**********************************@microsof t.com...
I have an ASP page to download a CSV file using the following code:

Response.ContentType="text/plain"
Response.AddHeader "Content-disposition", "attachment; filename=Report.csv" Response.Write strCSV

When I run this, I get the download dialog displayed twice. Any ideas how to solve this?
Thanks

Jul 19 '05 #2
When I try that I get the dowload dialog twice, but Notepad only opens after the second time

I have also discovered that this only happens when the page is requested using POST rather than GET. Also, it is a browser issue as it happens with IE6 SP1 but not with IE6 SP2 (the version with Windows XP SP2 RC1) or Mozilla 1.

Thank

Bil
----- Patrice wrote: ----

Really weird. I would start by tring just those lines

<
Response.AddHeader "Content-disposition", "attachment; filename=Report.txt
Response.Write "Hello World !
%

Do you have the download dialog twice ? Does it open notepad twice

Patric

"BillH" <an*******@discussions.microsoft.com> a écrit dans le message d
news:69**********************************@microsof t.com..
I have an ASP page to download a CSV file using the following code
Response.ContentType="text/plain Response.AddHeader "Content-disposition", "attachment

filename=Report.csv Response.Write strCS
When I run this, I get the download dialog displayed twice. Any ideas ho to solve this Thank

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2241
by: Brian Paul | last post by:
When a user clicks on a linkbutton on a page, i would like to render a printer-friendly version of the asp.net page and download it as an html attachment to the browser. The code below works great,...
0
1533
by: Xavier Osa | last post by:
Hi, I have an ASP.Net web page that you can download a file. As Fergunson's problem, it prompts twice dialog boxes only if I select Open button. If I select Save button, it prompts once. I'm...
2
1651
by: Sharon | last post by:
Hi all. I have an aspx page that starts a download: Response.WriteFile(file). The problem is that the Open / Save dialog appears twice when i choose Open. Any idea why? 10x. Sharon.
1
1695
by: Bernard Matthews | last post by:
I'm using the following code to stream a CSV file download to the client browser - HttpContext.Current.Response.Buffer = true; HttpContext.Current.Response.ClearContent();...
4
1430
by: ACaunter | last post by:
Hi, when the download dialog box opens and i click save or open or cancel.. everything works fine.. but then it's stuck in memory or something, because nomatter what button, listbox, combobox,...
0
2047
by: Thomas Gurath | last post by:
I have some code that reads a file from disk and inserts it into the http response. When the user clicks the file's title linkbutton, the File Download prompt appears twice if they select Open...
4
1743
by: Vikram | last post by:
i am using following code in button click... of asp.net code behind page Response.Clear() 'clears the current output content from the buffer Response.AppendHeader("Content-Disposition", _ ...
4
3093
by: L. Scott M. | last post by:
I am invoking a file download using the following code: Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + downloadFile.Name);...
7
2908
beacon
by: beacon | last post by:
I've searched and searched for the answer to this question, but all I can find is javascript answers and I'm really not using javascript in my code. I have a link to a powerpoint presentation and...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7060
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6760
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7022
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3013
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1311
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.