G
Guest
Hi,
I am using the code below to stream a CSV file with the response object.
Dim FileName As String = "Test.csv"
With Web.HttpContext.Current.Response
Web.HttpContext.Current.Response.AddHeader("content-disposition",
"attachment; filename=" & FileName)
.Charset = ""
.Write(Output.ToString()) ' Output is a StringBuilder object
with the content to write
.End()
End With
But when this code has been executed, a dialog pops up asking the user
whether to save or open the file. If the user clicks "Open", the dialog pops
up again. After cliking "Open" in the second dialog, the file is opened by
Excel. If the user clicks "Save", the file is saved, and the dialog has only
appeared once.
In the first dialog "Always ask before opening this type of file" is grayed
out - in the second it is enabled, and checked.
Why does the dialog show up twice? Has it something to do with the browser
settings, or what am I doing wrong? I would appreciate any kind of help.
Thanks,
Dorte
I am using the code below to stream a CSV file with the response object.
Dim FileName As String = "Test.csv"
With Web.HttpContext.Current.Response
Web.HttpContext.Current.Response.AddHeader("content-disposition",
"attachment; filename=" & FileName)
.Charset = ""
.Write(Output.ToString()) ' Output is a StringBuilder object
with the content to write
.End()
End With
But when this code has been executed, a dialog pops up asking the user
whether to save or open the file. If the user clicks "Open", the dialog pops
up again. After cliking "Open" in the second dialog, the file is opened by
Excel. If the user clicks "Save", the file is saved, and the dialog has only
appeared once.
In the first dialog "Always ask before opening this type of file" is grayed
out - in the second it is enabled, and checked.
Why does the dialog show up twice? Has it something to do with the browser
settings, or what am I doing wrong? I would appreciate any kind of help.
Thanks,
Dorte