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

Discussion in 'ASP General' started by Manny, Aug 29, 2003.

  1. Manny

    Manny Guest

    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, Aug 29, 2003
    #1
    1. Advertising

  2. Manny

    JJ Guest

    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&RunTimeCriteria=&Flag=1 302
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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.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" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:%...
    > : 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?
    > :
    > :
    >
    >
     
    JJ, Aug 29, 2003
    #2
    1. Advertising

  3. Manny

    Ken Schaefer Guest

    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" <> wrote in message
    news:%...
    : 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&RunTimeCriteria=&Flag=1 302
    : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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.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, Aug 29, 2003
    #3
  4. Manny

    JJ Guest

    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" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:%...
    > : 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&RunTimeCriteria=&Flag=1 302
    > : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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.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.
    >
    >
     
    JJ, Aug 29, 2003
    #4
  5. Manny

    JJ Guest

    I checked around and apparently this is an issue with PDF's causing 2 or 3
    requests to be sent.

    "JJ" <> wrote in message
    news:%...
    > 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" <> wrote in message
    > news:%...
    > > 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" <> wrote in message
    > > news:%...
    > > : 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&RunTimeCriteria=&Flag=1 302
    > > : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > > : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > > : Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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.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.
    > >
    > >

    >
    >
     
    JJ, Aug 29, 2003
    #5
  6. Manny

    Ken Schaefer Guest

    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" <> wrote in message
    news:%...
    : I checked around and apparently this is an issue with PDF's causing 2 or 3
    : requests to be sent.
    :
    : "JJ" <> wrote in message
    : news:%...
    : > 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" <> wrote in message
    : > news:%...
    : > > 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" <> wrote in message
    : > > news:%...
    : > > : 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&RunTimeCriteria=&Flag=1 302
    : > > :
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    : > > :
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    : > > :
    Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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.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, Aug 30, 2003
    #6
  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.
     
    Michael D. Kersey, Aug 30, 2003
    #7
  8. Manny

    Manny Guest

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

    3
    > : requests to be sent.
    > :
    > : "JJ" <> wrote in message
    > : news:%...
    > : > 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" <> wrote in message
    > : > news:%...
    > : > > 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" <> wrote in message
    > : > > news:%...
    > : > > : 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&RunTimeCriteria=&Flag=1

    302
    > : > > :
    > Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > : > > :
    > Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > : > > :
    > Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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.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.
    > : > >
    > : > >
    > : >
    > : >
    > :
    > :
    >
    >
     
    Manny, Aug 30, 2003
    #8
  9. Manny

    Manny Guest

    BTW, I found an MS KB article that describes the problem:

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792


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

    3
    > : requests to be sent.
    > :
    > : "JJ" <> wrote in message
    > : news:%...
    > : > 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" <> wrote in message
    > : > news:%...
    > : > > 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" <> wrote in message
    > : > > news:%...
    > : > > : 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&RunTimeCriteria=&Flag=1

    302
    > : > > :
    > Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > : > > :
    > Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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%5CClientData%5Ctemp%5Crad5BCDC.tmp&Title=Job%20List 200
    > : > > :
    > Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+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.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.
    > : > >
    > : > >
    > : >
    > : >
    > :
    > :
    >
    >
     
    Manny, Aug 30, 2003
    #9
  10. Manny

    Manny Guest

    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.aspx?scid=kb;EN-US;q293792


    "Michael D. Kersey" <> wrote in message
    news:...
    >
    > 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.
     
    Manny, Aug 30, 2003
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. erdem

    page_load executes twice ?

    erdem, Jul 23, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,863
    erdem
    Jul 23, 2004
  2. aspx page executes twice

    , Mar 27, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    400
  3. TechCrazy
    Replies:
    5
    Views:
    398
    Karl Heinz Buchegger
    Jul 15, 2005
  4. David C

    Code in Page_Load executes twice

    David C, Aug 8, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    635
  5. Phil Sweeney

    "onClick" using c# / ASP.NET executes twice on a single click?

    Phil Sweeney, Nov 7, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    328
    Keith Smith [MSFT]
    Dec 5, 2003
Loading...

Share This Page