473,735 Members | 2,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="Output Data()">

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.Redire ct
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.Binary Write 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 3178
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&vi ewid=226&title= Job%20List&RunT imeCriteria=&Fl ag=1 302
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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.Redire ct 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.Redire ct 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*******@THIS adOpenStatic.co m> wrote in message
news:e7******** ******@tk2msftn gp13.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***@keepyour spam.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.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="Output Data()">
:
: 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.Redire ct : 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.Binary Write 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.co m> wrote in message
news:%2******** ********@tk2msf tngp13.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&vi ewid=226&title= Job%20List&RunT imeCriteria=&Fl ag=1 302
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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.Redire ct 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.Redire ct 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***@keepyour spam.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="Outpu tData()">

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.Redire ct
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.Binar yWrite 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,
<%@ EnableSessionSt ate = 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.Conten tType "applicatio n/pdf"
Response.Binary Write 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
"applicatio n/vnd.ms-excel" to start Excel and that doesn't request the page
twice.

"Ken Schaefer" <ke*******@THIS adOpenStatic.co m> wrote in message
news:%2******** ********@TK2MSF TNGP12.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.co m> wrote in message
news:%2******** ********@tk2msf tngp13.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&vi ewid=226&title= Job%20List&RunT imeCriteria=&Fl ag=1 302
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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.Redire ct 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.Redire ct 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.co m> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.Conten tType "applicatio n/pdf"
Response.Binary Write 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
"applicatio n/vnd.ms-excel" to start Excel and that doesn't request the page twice.

"Ken Schaefer" <ke*******@THIS adOpenStatic.co m> wrote in message
news:%2******** ********@TK2MSF TNGP12.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.co m> wrote in message
news:%2******** ********@tk2msf tngp13.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&vi ewid=226&title= Job%20List&RunT imeCriteria=&Fl ag=1 302
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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.Redire ct 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.Redire ct 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.Redire ct() 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.co m> wrote in message
news:%2******** ********@tk2msf tngp13.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.co m> wrote in message
: news:%2******** ********@TK2MSF TNGP11.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.Conten tType "applicatio n/pdf"
: > Response.Binary Write 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
: > "applicatio n/vnd.ms-excel" to start Excel and that doesn't request the
: page
: > twice.
: >
: > "Ken Schaefer" <ke*******@THIS adOpenStatic.co m> wrote in message
: > news:%2******** ********@TK2MSF TNGP12.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.co m> wrote in message
: > > news:%2******** ********@tk2msf tngp13.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&vi ewid=226&title= Job%20List&RunT imeCriteria=&Fl ag=1 302
: > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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.Redire ct 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.Redire ct 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="Output Data()">
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.Redire ct
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.Binary Write 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.c om 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*******@THIS adOpenStatic.co m> wrote in message
news:uQ******** ******@TK2MSFTN GP12.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.Redire ct() 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.co m> wrote in message
news:%2******** ********@tk2msf tngp13.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.co m> wrote in message
: news:%2******** ********@TK2MSF TNGP11.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.Conten tType "applicatio n/pdf"
: > Response.Binary Write 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
: > "applicatio n/vnd.ms-excel" to start Excel and that doesn't request the
: page
: > twice.
: >
: > "Ken Schaefer" <ke*******@THIS adOpenStatic.co m> wrote in message
: > news:%2******** ********@TK2MSF TNGP12.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.co m> wrote in message
: > > news:%2******** ********@tk2msf tngp13.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&vi ewid=226&title= Job%20List&RunT imeCriteria=&Fl ag=1 302 : > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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.Redire ct 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.Redire ct 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*******@THIS adOpenStatic.co m> wrote in message
news:uQ******** ******@TK2MSFTN GP12.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.Redire ct() 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.co m> wrote in message
news:%2******** ********@tk2msf tngp13.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.co m> wrote in message
: news:%2******** ********@TK2MSF TNGP11.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.Conten tType "applicatio n/pdf"
: > Response.Binary Write 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
: > "applicatio n/vnd.ms-excel" to start Excel and that doesn't request the
: page
: > twice.
: >
: > "Ken Schaefer" <ke*******@THIS adOpenStatic.co m> wrote in message
: > news:%2******** ********@TK2MSF TNGP12.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.co m> wrote in message
: > > news:%2******** ********@tk2msf tngp13.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&vi ewid=226&title= Job%20List&RunT imeCriteria=&Fl ag=1 302 : > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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%5CClien tData%5Ctemp%5C rad5BCDC.tmp&Ti tle=Job%20List 200
: > > :
Mozilla/4.0+(compatible ;+MSIE+6.0;+Win dows+NT+5.0;+.N ET+CLR+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.Redire ct 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.Redire ct 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

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

Similar topics

3
2533
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 loading) but then somehow page load executes again and then page is displayed... but there is different thing. when page executes page load second time,,
6
6009
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 AutoEventWireup=True in your page header?" In my project, I have this set to false - everywhere.
3
2427
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 one of the Web User Controls. This particular Web User Control has some text entry fields in it,
2
3417
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 and clicks the save button on it. The info is saved to the DB and the parent page is refreshed. Everything works fine but for some reason the page load is called twice. I have set the AutoEventWireUp = false on every page. Also I have load event...
8
2761
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 this is happening. there are no transfers or redirects that are occurring in the pages. the page runs thru all of its events then starts all over again. Trying to inspect the stack track doesn't help because when i get to the init the 2nd time,...
0
1141
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 have checked for autoeventwireup. it is set to false in all the pages.cant say why is this happenning or i suppose that for frames this is an existing issue.. In Report.aspx i am generating an crystal report in PDF Format. I'LL
0
1400
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 unusual about this link, and looks something like this: mypage.aspx?ClientID=3 in this case, the target page actually creates a Crystal report that
4
2860
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 reason for that. Here is what I found out. When you have an ImageButton with no ImageURL set, it will always do that. This was not the case with .NET 1.0. So if you need to experiment with ImageButton, set something to the ImageUrl
4
2362
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 the application eventlog in OnStart ("service has started and is ready to watch the filesystem") and this results in two entries in the eventlog. Also, the handler for the FileSystemWatcher seems to be fired twice if something happens with a...
0
9462
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9248
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9199
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6049
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4558
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4821
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2187
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.