473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Stumped - page executes twice sometimes (even thrice occasionally!)

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?
Jul 19 '05 #1
10 3149
JJ
Ken,

I checked the logs and it looks like the browser (or something in between)
is doing it twice:

2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
/virtualdir/Page1.asp
ReportID=734&viewid=226&title=Job%20List&RunTimeCr iteria=&Flag=1 302
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
/virtualdir/Page2.asp
Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
2003-08-29 12:57:37 192.168.1.95 username 192.168.1.11 80 GET
/virtualdir/Page2.asp
Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)

The first line is where Page1.asp is requested (by the window.location="" in
the javascript code executed on the OnClick event for the button).

The second line is the page requested by the Response.Redirect by Page1.asp.

The third line is a duplicate of the second request - I don't know why that
is showing up.

I don't discount that it could be a logic error, but I would be suprised -
there is only one Response.Redirect in Page1.asp and none in Page2.asp -
looking at the code, I can imagine what could possibly even cause that even
if I wanted to do it on purpose.
"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
Have a look in your IIS log - is the page being requested multiple times by the browser (ie, is the browser sending multiple HTTP requests?)

If not, then there's some kind of logical error in your programming code.

If there are multiple HTTP requests being logged, then either the browser is doing something funny, or something inbetween the browser and the server (eg some kind of proxy) is doing something funny.

But, at least this will help us isolate the problem...

Cheers
Ken
"Manny" <ma***@keepyourspam.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
: 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?
:
:

Jul 19 '05 #2
Looking at that, it doesn't look like a logic error - it definately looks
like the browser is sending two identical requests, about 2 seconds apart.
The question is "why?" :-)

I assume there's no proxy? Also, check the HTTP status for the duplicate
requests - are they both 200 (HTTP OK?). Maybe PDF files are causing the
browser to go back to the server or something?

(I'll admit that I'm a bit stumped!)

Cheers
Ken
"JJ" <jj@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: Ken,
:
: I checked the logs and it looks like the browser (or something in between)
: is doing it twice:
:
: 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page1.asp
: ReportID=734&viewid=226&title=Job%20List&RunTimeCr iteria=&Flag=1 302
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page2.asp
: Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: 2003-08-29 12:57:37 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page2.asp
: Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
:
: The first line is where Page1.asp is requested (by the window.location=""
in
: the javascript code executed on the OnClick event for the button).
:
: The second line is the page requested by the Response.Redirect by
Page1.asp.
:
: The third line is a duplicate of the second request - I don't know why
that
: is showing up.
:
: I don't discount that it could be a logic error, but I would be suprised -
: there is only one Response.Redirect in Page1.asp and none in Page2.asp -
: looking at the code, I can imagine what could possibly even cause that
even
: if I wanted to do it on purpose.
Jul 19 '05 #3
On Thu, 28 Aug 2003 23:06:22 -0400, "Manny" <ma***@keepyourspam.com> wrote:
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?

Manny,
Your problem MAY be similar to one I'm having. I submit a form to an
ASP page using a single button click, and it ends up getting submitted
twice. I've been able to determine by using NETMON to capture the
packets exchanged that after the first correct submission the client
then executes another submission, this time with cookie data, which
I assume the server is asking for right after the first correct submission.
Oddly, if the first submission used GET as a method, which seems to be
your case, all the form data gets resubmitted with the cookie data, so
everything actually works for my needs.. See if you can get a packet
capture and examine the data for a second redirect the also has cookie
data in it. Also turning Sessions off might solve the problem,
<%@ EnableSessionState = False %>
even just to see if cookies are the culprit.
Hope this helps,
TurboDuster

Jul 19 '05 #4
JJ
I do think it has something to do with the PDF files.

If I remove the two lines that "cause" it to be a PDF:

Response.ContentType "application/pdf"
Response.BinaryWrite objStream.Read(1)

Then it does not request the page twice. Of course, I need it to be a
PDF...

I have another version that spits out HTML with a ContentType of
"application/vnd.ms-excel" to start Excel and that doesn't request the page
twice.

"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Looking at that, it doesn't look like a logic error - it definately looks
like the browser is sending two identical requests, about 2 seconds apart.
The question is "why?" :-)

I assume there's no proxy? Also, check the HTTP status for the duplicate
requests - are they both 200 (HTTP OK?). Maybe PDF files are causing the
browser to go back to the server or something?

(I'll admit that I'm a bit stumped!)

Cheers
Ken
"JJ" <jj@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: Ken,
:
: I checked the logs and it looks like the browser (or something in between) : is doing it twice:
:
: 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page1.asp
: ReportID=734&viewid=226&title=Job%20List&RunTimeCr iteria=&Flag=1 302
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page2.asp
: Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: 2003-08-29 12:57:37 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page2.asp
: Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
:
: The first line is where Page1.asp is requested (by the window.location="" in
: the javascript code executed on the OnClick event for the button).
:
: The second line is the page requested by the Response.Redirect by
Page1.asp.
:
: The third line is a duplicate of the second request - I don't know why
that
: is showing up.
:
: I don't discount that it could be a logic error, but I would be suprised - : there is only one Response.Redirect in Page1.asp and none in Page2.asp -
: looking at the code, I can imagine what could possibly even cause that
even
: if I wanted to do it on purpose.

Jul 19 '05 #5
JJ
I checked around and apparently this is an issue with PDF's causing 2 or 3
requests to be sent.

"JJ" <jj@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I do think it has something to do with the PDF files.

If I remove the two lines that "cause" it to be a PDF:

Response.ContentType "application/pdf"
Response.BinaryWrite objStream.Read(1)

Then it does not request the page twice. Of course, I need it to be a
PDF...

I have another version that spits out HTML with a ContentType of
"application/vnd.ms-excel" to start Excel and that doesn't request the page twice.

"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Looking at that, it doesn't look like a logic error - it definately looks like the browser is sending two identical requests, about 2 seconds apart. The question is "why?" :-)

I assume there's no proxy? Also, check the HTTP status for the duplicate
requests - are they both 200 (HTTP OK?). Maybe PDF files are causing the
browser to go back to the server or something?

(I'll admit that I'm a bit stumped!)

Cheers
Ken
"JJ" <jj@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: Ken,
:
: I checked the logs and it looks like the browser (or something in

between)
: is doing it twice:
:
: 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page1.asp
: ReportID=734&viewid=226&title=Job%20List&RunTimeCr iteria=&Flag=1 302
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page2.asp
: Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: 2003-08-29 12:57:37 192.168.1.95 username 192.168.1.11 80 GET
: /virtualdir/Page2.asp
: Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
:
: The first line is where Page1.asp is requested (by the

window.location=""
in
: the javascript code executed on the OnClick event for the button).
:
: The second line is the page requested by the Response.Redirect by
Page1.asp.
:
: The third line is a duplicate of the second request - I don't know why
that
: is showing up.
:
: I don't discount that it could be a logic error, but I would be

suprised -
: there is only one Response.Redirect in Page1.asp and none in Page2.asp - : looking at the code, I can imagine what could possibly even cause that
even
: if I wanted to do it on purpose.


Jul 19 '05 #6
That's what I'm beginning to think - perhaps the Adobe Acrobat Reader on the
client issues a second request back to the server or something...

Maybe you could alter the way your app works, so that the PDF is saved to
the filesystem (on page2.asp), and then you Response.Redirect() to page3.asp
which loads, and streams the PDF back to the client (obviously you'd then
need some code, either on the page, or as part of some clean-up function to
clean up all the old temporary PDF files). That way, even if there were
multiple requests for the PDF file, it wouldn't really have any impact.

Cheers
Ken

"JJ" <jj@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: I checked around and apparently this is an issue with PDF's causing 2 or 3
: requests to be sent.
:
: "JJ" <jj@nospam.com> wrote in message
: news:%2****************@TK2MSFTNGP11.phx.gbl...
: > I do think it has something to do with the PDF files.
: >
: > If I remove the two lines that "cause" it to be a PDF:
: >
: > Response.ContentType "application/pdf"
: > Response.BinaryWrite objStream.Read(1)
: >
: > Then it does not request the page twice. Of course, I need it to be a
: > PDF...
: >
: > I have another version that spits out HTML with a ContentType of
: > "application/vnd.ms-excel" to start Excel and that doesn't request the
: page
: > twice.
: >
: > "Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
: > news:%2****************@TK2MSFTNGP12.phx.gbl...
: > > Looking at that, it doesn't look like a logic error - it definately
: looks
: > > like the browser is sending two identical requests, about 2 seconds
: apart.
: > > The question is "why?" :-)
: > >
: > > I assume there's no proxy? Also, check the HTTP status for the
duplicate
: > > requests - are they both 200 (HTTP OK?). Maybe PDF files are causing
the
: > > browser to go back to the server or something?
: > >
: > > (I'll admit that I'm a bit stumped!)
: > >
: > > Cheers
: > > Ken
: > >
: > >
: > > "JJ" <jj@nospam.com> wrote in message
: > > news:%2****************@tk2msftngp13.phx.gbl...
: > > : Ken,
: > > :
: > > : I checked the logs and it looks like the browser (or something in
: > between)
: > > : is doing it twice:
: > > :
: > > : 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page1.asp
: > > : ReportID=734&viewid=226&title=Job%20List&RunTimeCr iteria=&Flag=1 302
: > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > : 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page2.asp
: > > : Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > : 2003-08-29 12:57:37 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page2.asp
: > > : Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > :
: > > : The first line is where Page1.asp is requested (by the
: > window.location=""
: > > in
: > > : the javascript code executed on the OnClick event for the button).
: > > :
: > > : The second line is the page requested by the Response.Redirect by
: > > Page1.asp.
: > > :
: > > : The third line is a duplicate of the second request - I don't know
why
: > > that
: > > : is showing up.
: > > :
: > > : I don't discount that it could be a logic error, but I would be
: > suprised -
: > > : there is only one Response.Redirect in Page1.asp and none in
: Page2.asp -
: > > : looking at the code, I can imagine what could possibly even cause
that
: > > even
: > > : if I wanted to do it on purpose.
: > >
: > >
: >
: >
:
:
Jul 19 '05 #7
Manny wrote:
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?


Instead of describing of what you *believe* the code does, please post
the code itself. That way we might be able to determine *what the code
actually does* and how to correct the problem.
Jul 19 '05 #8
I did a groups.google.com search on "Content-Type: application/pdf twice"
and there are numerous posts of exactly the same problem, so it is Acrobat
that is doing it (or at least the combination of Acrobat and IE).

Your suggestion sounds like it might work - I'll have to give it a try.
Page3.asp must delete the generated PDF after it is streamed to the
browser - while I probably could have something set up that cleaned up the
PDF's every hour or so, trying to get approval for that to be implemented is
a little tougher.

I'm not sure what's going to happen if Page3.asp streams the PDF, then
deletes it. The second request for Page3.asp will see that the PDF file is
gone and do nothing, but the question is what really is being displayed in
the browser - is it the stream from the first request or the stream from the
second request (my bet is the second, which blows away that idea). Although
I'd be curious to know why Acrobat throws away the first stream if that is
the case.

"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
That's what I'm beginning to think - perhaps the Adobe Acrobat Reader on the client issues a second request back to the server or something...

Maybe you could alter the way your app works, so that the PDF is saved to
the filesystem (on page2.asp), and then you Response.Redirect() to page3.asp which loads, and streams the PDF back to the client (obviously you'd then
need some code, either on the page, or as part of some clean-up function to clean up all the old temporary PDF files). That way, even if there were
multiple requests for the PDF file, it wouldn't really have any impact.

Cheers
Ken

"JJ" <jj@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: I checked around and apparently this is an issue with PDF's causing 2 or 3 : requests to be sent.
:
: "JJ" <jj@nospam.com> wrote in message
: news:%2****************@TK2MSFTNGP11.phx.gbl...
: > I do think it has something to do with the PDF files.
: >
: > If I remove the two lines that "cause" it to be a PDF:
: >
: > Response.ContentType "application/pdf"
: > Response.BinaryWrite objStream.Read(1)
: >
: > Then it does not request the page twice. Of course, I need it to be a
: > PDF...
: >
: > I have another version that spits out HTML with a ContentType of
: > "application/vnd.ms-excel" to start Excel and that doesn't request the
: page
: > twice.
: >
: > "Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
: > news:%2****************@TK2MSFTNGP12.phx.gbl...
: > > Looking at that, it doesn't look like a logic error - it definately
: looks
: > > like the browser is sending two identical requests, about 2 seconds
: apart.
: > > The question is "why?" :-)
: > >
: > > I assume there's no proxy? Also, check the HTTP status for the
duplicate
: > > requests - are they both 200 (HTTP OK?). Maybe PDF files are causing
the
: > > browser to go back to the server or something?
: > >
: > > (I'll admit that I'm a bit stumped!)
: > >
: > > Cheers
: > > Ken
: > >
: > >
: > > "JJ" <jj@nospam.com> wrote in message
: > > news:%2****************@tk2msftngp13.phx.gbl...
: > > : Ken,
: > > :
: > > : I checked the logs and it looks like the browser (or something in
: > between)
: > > : is doing it twice:
: > > :
: > > : 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page1.asp
: > > : ReportID=734&viewid=226&title=Job%20List&RunTimeCr iteria=&Flag=1 302 : > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > : 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page2.asp
: > > : Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > : 2003-08-29 12:57:37 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page2.asp
: > > : Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > :
: > > : The first line is where Page1.asp is requested (by the
: > window.location=""
: > > in
: > > : the javascript code executed on the OnClick event for the button).
: > > :
: > > : The second line is the page requested by the Response.Redirect by
: > > Page1.asp.
: > > :
: > > : The third line is a duplicate of the second request - I don't know
why
: > > that
: > > : is showing up.
: > > :
: > > : I don't discount that it could be a logic error, but I would be
: > suprised -
: > > : there is only one Response.Redirect in Page1.asp and none in
: Page2.asp -
: > > : looking at the code, I can imagine what could possibly even cause
that
: > > even
: > > : if I wanted to do it on purpose.
: > >
: > >
: >
: >
:
:

Jul 19 '05 #9
BTW, I found an MS KB article that describes the problem:

http://support.microsoft.com/default...;EN-US;q293792
"Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
news:uQ**************@TK2MSFTNGP12.phx.gbl...
That's what I'm beginning to think - perhaps the Adobe Acrobat Reader on the client issues a second request back to the server or something...

Maybe you could alter the way your app works, so that the PDF is saved to
the filesystem (on page2.asp), and then you Response.Redirect() to page3.asp which loads, and streams the PDF back to the client (obviously you'd then
need some code, either on the page, or as part of some clean-up function to clean up all the old temporary PDF files). That way, even if there were
multiple requests for the PDF file, it wouldn't really have any impact.

Cheers
Ken

"JJ" <jj@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
: I checked around and apparently this is an issue with PDF's causing 2 or 3 : requests to be sent.
:
: "JJ" <jj@nospam.com> wrote in message
: news:%2****************@TK2MSFTNGP11.phx.gbl...
: > I do think it has something to do with the PDF files.
: >
: > If I remove the two lines that "cause" it to be a PDF:
: >
: > Response.ContentType "application/pdf"
: > Response.BinaryWrite objStream.Read(1)
: >
: > Then it does not request the page twice. Of course, I need it to be a
: > PDF...
: >
: > I have another version that spits out HTML with a ContentType of
: > "application/vnd.ms-excel" to start Excel and that doesn't request the
: page
: > twice.
: >
: > "Ken Schaefer" <ke*******@THISadOpenStatic.com> wrote in message
: > news:%2****************@TK2MSFTNGP12.phx.gbl...
: > > Looking at that, it doesn't look like a logic error - it definately
: looks
: > > like the browser is sending two identical requests, about 2 seconds
: apart.
: > > The question is "why?" :-)
: > >
: > > I assume there's no proxy? Also, check the HTTP status for the
duplicate
: > > requests - are they both 200 (HTTP OK?). Maybe PDF files are causing
the
: > > browser to go back to the server or something?
: > >
: > > (I'll admit that I'm a bit stumped!)
: > >
: > > Cheers
: > > Ken
: > >
: > >
: > > "JJ" <jj@nospam.com> wrote in message
: > > news:%2****************@tk2msftngp13.phx.gbl...
: > > : Ken,
: > > :
: > > : I checked the logs and it looks like the browser (or something in
: > between)
: > > : is doing it twice:
: > > :
: > > : 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page1.asp
: > > : ReportID=734&viewid=226&title=Job%20List&RunTimeCr iteria=&Flag=1 302 : > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > : 2003-08-29 12:57:35 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page2.asp
: > > : Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > : 2003-08-29 12:57:37 192.168.1.95 username 192.168.1.11 80 GET
: > > : /virtualdir/Page2.asp
: > > : Fn=C%3A%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=J ob%20List 200
: > > :
Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CL R+1.0.3705)
: > > :
: > > : The first line is where Page1.asp is requested (by the
: > window.location=""
: > > in
: > > : the javascript code executed on the OnClick event for the button).
: > > :
: > > : The second line is the page requested by the Response.Redirect by
: > > Page1.asp.
: > > :
: > > : The third line is a duplicate of the second request - I don't know
why
: > > that
: > > : is showing up.
: > > :
: > > : I don't discount that it could be a logic error, but I would be
: > suprised -
: > > : there is only one Response.Redirect in Page1.asp and none in
: Page2.asp -
: > > : looking at the code, I can imagine what could possibly even cause
that
: > > even
: > > : if I wanted to do it on purpose.
: > >
: > >
: >
: >
:
:

Jul 19 '05 #10
In general, I agree that posting code would help in the analysis. But in
this case, I really believed that it was not the code that was causing the
problem.

And it turns out I was right in that assessment. I found that it is not the
code, but IE/Acrobat causing the problem:

http://support.microsoft.com/default...;EN-US;q293792
"Michael D. Kersey" <md******@hal-pc.org> wrote in message
news:3F***************@hal-pc.org...

Instead of describing of what you *believe* the code does, please post
the code itself. That way we might be able to determine *what the code
actually does* and how to correct the problem.

Jul 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: erdem | last post by:
hi, i have a problem with asp.net when i was debugging i put breakpoint to pageload event and then i discovered that page is loaded once (explorer shows full page correctly but continues...
6
by: Dot net work | last post by:
I've read quite a few threads on these groups about this. When someone says the following: "My Page_Load gets called twice on a button click postback" The replies are: "Do you have...
3
by: doobdave | last post by:
Hi all, I'm experiencing a rather strange problem: I am coding a web application using VB.net ASP.net and Visual Studio 2003. It's quite a large application, but the problem only occurs on...
2
by: Samy | last post by:
Hi There, I have a user control with buttons on it which I use on a aspx page (parent page). On a button click, a modal dialog(aspx page) opens up and the user enters some info in the modal dialog...
8
by: TS | last post by:
Hi, i have inherited a page from another user. The page is the target frame in a frameset. for some reason the whole page runs twice (page_load, init, etc. all run twice) I can't figure out how...
0
by: rajendra.mishra | last post by:
Hi... I have a frame(Report.htm) which has two aspx pages one for header(header.aspx) and the other for displaying reports(Report.aspx). when Report.htm is called Report.aspx executes twice. I...
0
by: Steven Nagy | last post by:
howdy all, As suggested, I have a web page that is executing the page life cycle twice (Init, page_load, prerender, etc) You arrive at this page by a common client side link. There is nothing...
4
by: David C | last post by:
I spent the last four hours trying to figure out why Page_Load would execute twice. Even stranger was that everything within if (! IsPostBack){....} executed twice as well. There is no rhyme or...
4
by: Tom Van den Brandt | last post by:
Hi, I wrote a simple windows service that includes a FileSystemWatcher. After building and installing the service (installutil) I notice that the service executes twice. I included a write to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.