Results 1 to 3 of 3
Jun 13, 2012, 03:32 #1
- Join Date
- Oct 2010
- 0 Post(s)
- 0 Thread(s)
Can you 'reset' Response.ContentType ??
My client wants to extract records by country from an Excel spreadsheet.
So I have one script which reloads itself twice :-
phase 1. display initial form, user select s country and Submits
form action reloads itself with querystring '...?Extract=YES'
phase 2. Extract=YES
the extract code contains the following
Response.Buffer = trueand stores a record count/message in session variables
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=Extract_List_" &myCountry &".xls"
now somehow reload script with querystring '...?Extract=DONE'
phase 3. Extract=DONE
display record count/message in session variables using Response.write
The actual extract works fine, creates the Excel file, but then stops/hangs ??
It doesn't reload and perform phase 3.
From 100s tests and various answers via Google, I've gathered that it's the RESPONSE method that I'm not understanding or using correctly. I've tried :
Response.AddHeader "Refresh", "0;URL=scriptname?Extract=DONE"
Server.Transfer doesn't accept the ?Extract=DONE
window.location.href = "scriptname?Extract=DONE"
but nothing happens
Is there a way to 'reset' the Response.ContentType and Headers?, so I can Response.write my record count/message ??
Can anyone dig me out of this hole ??
Thanks in advance