PDA

View Full Version : aspx csv download error


tomtom
02-22-2010, 06:31 AM
Hi,
Got this code that makes a downloadable csv from the makeTextfromDT function which makes csv from a datatable.
When run locally it runs fine. I cannot upload it to the 'root' of the website as this is currently live. So I created another folder, uploaded the app and made it an application.
I then get an error which essentially says I am trying to download the .aspx and this is blocked.
Any help appreciated
Thanks
Tom


Response.ContentType = "text/comma-separated-values"
Response.AddHeader("Content-Disposition", "attachment; filename=" & sReportName & ".csv")
EnableViewState = False
Response.Write(makeTextfromDT(dtResults, False))

tomtom
02-24-2010, 03:26 AM
Hi
In addition to Response.Clear() I had to:


Response.ClearContent()
Response.ClearHeaders()


Works now.

Thanks.