Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Stumped - page executes twice sometimes (even thrice occasionally!)

Reply
Thread Tools

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

 
 
Manny
Guest
Posts: n/a
 
      08-29-2003
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?


 
Reply With Quote
 
 
 
 
JJ
Guest
Posts: n/a
 
      08-29-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> : 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?
> :
> :
>
>



 
Reply With Quote
 
 
 
 
Ken Schaefer
Guest
Posts: n/a
 
      08-29-2003
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
: 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.


 
Reply With Quote
 
JJ
Guest
Posts: n/a
 
      08-29-2003
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> : 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.
>
>



 
Reply With Quote
 
JJ
Guest
Posts: n/a
 
      08-29-2003
I checked around and apparently this is an issue with PDF's causing 2 or 3
requests to be sent.

"JJ" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:%(E-Mail Removed)...
> > : 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.
> >
> >

>
>



 
Reply With Quote
 
Ken Schaefer
Guest
Posts: n/a
 
      08-30-2003
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
: I checked around and apparently this is an issue with PDF's causing 2 or 3
: requests to be sent.
:
: "JJ" <(E-Mail Removed)> wrote in message
: news:%(E-Mail Removed)...
: > 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" <(E-Mail Removed)> wrote in message
: > news:%(E-Mail Removed)...
: > > 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" <(E-Mail Removed)> wrote in message
: > > news:%(E-Mail Removed)...
: > > : 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.
: > >
: > >
: >
: >
:
:


 
Reply With Quote
 
Michael D. Kersey
Guest
Posts: n/a
 
      08-30-2003
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.
 
Reply With Quote
 
Manny
Guest
Posts: n/a
 
      08-30-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> : I checked around and apparently this is an issue with PDF's causing 2 or

3
> : requests to be sent.
> :
> : "JJ" <(E-Mail Removed)> wrote in message
> : news:%(E-Mail Removed)...
> : > 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" <(E-Mail Removed)> wrote in message
> : > news:%(E-Mail Removed)...
> : > > 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" <(E-Mail Removed)> wrote in message
> : > > news:%(E-Mail Removed)...
> : > > : 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.
> : > >
> : > >
> : >
> : >
> :
> :
>
>



 
Reply With Quote
 
Manny
Guest
Posts: n/a
 
      08-30-2003
BTW, I found an MS KB article that describes the problem:

http://support.microsoft.com/default...;EN-US;q293792


"Ken Schaefer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> : I checked around and apparently this is an issue with PDF's causing 2 or

3
> : requests to be sent.
> :
> : "JJ" <(E-Mail Removed)> wrote in message
> : news:%(E-Mail Removed)...
> : > 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" <(E-Mail Removed)> wrote in message
> : > news:%(E-Mail Removed)...
> : > > 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" <(E-Mail Removed)> wrote in message
> : > > news:%(E-Mail Removed)...
> : > > : 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.
> : > >
> : > >
> : >
> : >
> :
> :
>
>



 
Reply With Quote
 
Manny
Guest
Posts: n/a
 
      08-30-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code in Page_Load executes twice David C ASP .Net 5 08-09-2007 02:17 PM
aspx page executes twice rajendra.mishra@gmail.com ASP .Net 0 03-27-2006 04:18 PM
Why is copy constructor called only twice here (should be thrice?) TechCrazy C++ 5 07-15-2005 10:15 AM
page_load executes twice ? erdem ASP .Net 3 07-23-2004 08:28 PM
"onClick" using c# / ASP.NET executes twice on a single click? Phil Sweeney ASP .Net Web Controls 1 12-05-2003 06:04 PM



Advertisments