I am querying Informix and getting a record set. Then I loop through the RS and at the same time build an HTML table and (
customer's requirement) a string to return a CSV file.
I display the table with a series of
Response.Write
For the filename.csv I could do:
Response.ContentType = "application/download"
Response.AddHeader "Content-Disposition","attachment;filename=" & cFile
where
cFile
is a random filename that contains my
cOutput
string.
This of course generates an error on the
Response.ContentType
line as the browser already has something written.
How do I deal with this requirement? Do I send them to another page that does the download?