I have a page that dynamically creates a PDF based on data from a database. Once the code loops through the various tables and assembles the data, I use a response.redirect to take the user directly to the pdf file.
I would like to put up a simple "please wait while the pdf is generated" message on the screen, but for some reason, if I have a response.redirect on the screen, no html will show.
I've tried to set the buffer to true, and then response.flush it after the closing </html> tag, then running the response.redirect after the flush, but nothing happens... and the "please wait..." message is displayed, but I have stopped all processes.
so it goes a little something like this:
Scenario 1: Body info doesn't show up
Scenario 2: Use of response.buffer
*********************
'I do the flush here to try to get the browser to see the HTML text before I run the code... in hopes that I can allow the user to see that message, then generate the pdf, then response.redirect the user to the dynamically generated file
*********************
Earnie Eng
I would like to put up a simple "please wait while the pdf is generated" message on the screen, but for some reason, if I have a response.redirect on the screen, no html will show.
I've tried to set the buffer to true, and then response.flush it after the closing </html> tag, then running the response.redirect after the flush, but nothing happens... and the "please wait..." message is displayed, but I have stopped all processes.
so it goes a little something like this:
Scenario 1: Body info doesn't show up
Code:
<html>
<header stuff...>
<body>
<p>Please wait while the pdf is generated...</p>
</html>
<%
'the serious code goes here...
'the code finishes and writes a pdf file...
response.redirect "/docs/somePDF.pdf"
%>
Code:
<% response.buffer = true %>
<html>
<header stuff...>
<body>
<p>Please wait while the pdf is generated...</p>
</html>
<%
response.flush
*********************
'I do the flush here to try to get the browser to see the HTML text before I run the code... in hopes that I can allow the user to see that message, then generate the pdf, then response.redirect the user to the dynamically generated file
*********************
Code:
'the serious code goes here...
'the code finishes and writes a pdf file...
response.redirect "/docs/somePDF.pdf"
%>
Earnie Eng