M
Manny
I have a web form "Page1.asp" and it reads data from a database, does some
calculations, and displays the records in pages. Works fine.
I have a button that displays on the page, defined as <input type="button"
onClick="OutputData()">
The OutputData() function is a javascript function that simply does this:
window.location = "Page1.asp?Flag=1";
This "re-executes" Page1.asp, but with a flag set in the query string. The
logic in Page1.asp writes the data to a file when this flag is set instead
of paging it to the browser - it sends NOTHING to the browser when that flag
is set.
At the end of the data file generation, Page1.asp does a Response.Redirect
to Page2.asp, passing it the filename in the query string.
Page2.asp uses a COM object (DLL) we wrote in VB6 to further manipulate the
data and the end result is a PDF file that gets sent to the browser through
Response.BinaryWrite from an ADO binary stream. Page2.asp outputs no HTML
itself - only the PDF data.
What has me stumped is that Page2.asp is executing _multiple times_.
Usually it executes twice, but sometimes it executes 3 times. I can tell
because the COM object it uses writes some info to a log file. I clear the
log file, click on the button on Page1.asp _one_ time, and the log shows the
COM object being executed 2 or 3 times in a row. I cannot figure out why.
There are no loops in Page2.asp - it is a fairly simple ASP script, no
functions or sub's - just about 20 lines of script.
Page1.asp is definitely not redirecting to it multiple times. I put some
code in Page1.asp to log a timestamp each time it redirects to Page2.asp and
it only does it *once* after I click the button.
I put some code in Page2.asp to increment a Session variable and it does
increment it multiple times after a click, so it is definitely Page2.asp
that is executing multiple times. I did the same in Page1.asp and it
increments only one time per click.
Any ideas why this might be happening?
calculations, and displays the records in pages. Works fine.
I have a button that displays on the page, defined as <input type="button"
onClick="OutputData()">
The OutputData() function is a javascript function that simply does this:
window.location = "Page1.asp?Flag=1";
This "re-executes" Page1.asp, but with a flag set in the query string. The
logic in Page1.asp writes the data to a file when this flag is set instead
of paging it to the browser - it sends NOTHING to the browser when that flag
is set.
At the end of the data file generation, Page1.asp does a Response.Redirect
to Page2.asp, passing it the filename in the query string.
Page2.asp uses a COM object (DLL) we wrote in VB6 to further manipulate the
data and the end result is a PDF file that gets sent to the browser through
Response.BinaryWrite from an ADO binary stream. Page2.asp outputs no HTML
itself - only the PDF data.
What has me stumped is that Page2.asp is executing _multiple times_.
Usually it executes twice, but sometimes it executes 3 times. I can tell
because the COM object it uses writes some info to a log file. I clear the
log file, click on the button on Page1.asp _one_ time, and the log shows the
COM object being executed 2 or 3 times in a row. I cannot figure out why.
There are no loops in Page2.asp - it is a fairly simple ASP script, no
functions or sub's - just about 20 lines of script.
Page1.asp is definitely not redirecting to it multiple times. I put some
code in Page1.asp to log a timestamp each time it redirects to Page2.asp and
it only does it *once* after I click the button.
I put some code in Page2.asp to increment a Session variable and it does
increment it multiple times after a click, so it is definitely Page2.asp
that is executing multiple times. I did the same in Page1.asp and it
increments only one time per click.
Any ideas why this might be happening?