Page refresh after Excel download quirk
Posted: Thu Jan 20, 2011 10:40 am
I have a small program designed to export table data into Excel that has a strange issue.
Initially, the page will load with options to select a table view to export. When the user selects the option, the table data is extracted into an Excel file. On the first pass, this runs fine. BUT… when the user selects another option from the page, the browser will display a partial view of the plain html text.
What I think is happening is that after the Excel file is output, that the initial selection page is not being re-rendered and that there is a conflict between the Download header and the selection page.
I did a test on the page by setting an element to be visible on the user selection page by using a control variable. When the page initially loads, the variable is set to ‘ON’ and I reset this variable after the Excel is downloaded to ‘OFF’ (1 and 0). But, the element never clears after the Excel file is processed.
Has anyone ever seen this before? If so, what technique do you use to resolve this issue?
Initially, the page will load with options to select a table view to export. When the user selects the option, the table data is extracted into an Excel file. On the first pass, this runs fine. BUT… when the user selects another option from the page, the browser will display a partial view of the plain html text.
What I think is happening is that after the Excel file is output, that the initial selection page is not being re-rendered and that there is a conflict between the Download header and the selection page.
I did a test on the page by setting an element to be visible on the user selection page by using a control variable. When the page initially loads, the variable is set to ‘ON’ and I reset this variable after the Excel is downloaded to ‘OFF’ (1 and 0). But, the element never clears after the Excel file is processed.
Has anyone ever seen this before? If so, what technique do you use to resolve this issue?