ASP Page executed twice

Discussion in 'ASP General' started by Elie Grouchko, Feb 25, 2006.

  1. Hi

    I have an ASP page which is randomly (?) executed twice. I noticed that the
    http header is different, as if there are two different requests sent to the
    server. Header 2 below is the one that randomly occur.

    Although the 2 headers are different I don't understand why

    Help will be greatly appreciated

    Thanks

    Elie Grouchko


    Header 1

    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
    application/x-shockwave-flash, application/vnd.ms-excel,
    application/vnd.ms-powerpoint, application/msword, */* Accept-Language:
    en-nz Connection: Keep-Alive Host: localhost Referer:
    http://localhost/mysite/page.asp?subjectid=2&forumpage=3 User-Agent:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
    Cookie: userloginname=; ASPSESSIONIDCATRATAC=HGBDLENCAPADIEKHFACKMMFK
    Content-Length: 230 Content-Type: application/x-www-form-urlencoded
    Accept-Encoding: gzip, deflate Cache-Control: no-cache

    Header 2

    Accept: */* Accept-Language: en-nz Connection: Keep-Alive Host: localhost
    Referer: http://localhost/mysite/page.asp?subjectid=2&forumpage=4
    User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
    1.1.4322) Cookie: userloginname=;
    ASPSESSIONIDCATRATAC=HGBDLENCAPADIEKHFACKMMFK Accept-Encoding: gzip, deflate
     
    Elie Grouchko, Feb 25, 2006
    #1
    1. Advertising

  2. Hi again

    I resolved this issue, and wanted to share the solution as it may be of some
    help to others.

    On the specific page I was having a problem I am creating HTML code on the
    client side using the JavaScript 'document.write' method. One of the tags I
    am creating is an image <img src="" ... />. My plan was to populate the
    image at a later point so I left the 'src' property empty, which was a
    mistake... The img.src property is required, so the browser assumes that an
    empty img.src property means the root URL, and was sending another GET HTTP
    request and reloading the entire home-page.

    Moral: don't leave the img.src property empty...

    :)

    Elie


    "Elie Grouchko" <> wrote in message
    news:...
    > Hi
    >
    > I have an ASP page which is randomly (?) executed twice. I noticed that
    > the http header is different, as if there are two different requests sent
    > to the server. Header 2 below is the one that randomly occur.
    >
    > Although the 2 headers are different I don't understand why
    >
    > Help will be greatly appreciated
    >
    > Thanks
    >
    > Elie Grouchko
    >
    >
    > Header 1
    >
    > Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
    > application/x-shockwave-flash, application/vnd.ms-excel,
    > application/vnd.ms-powerpoint, application/msword, */* Accept-Language:
    > en-nz Connection: Keep-Alive Host: localhost Referer:
    > http://localhost/mysite/page.asp?subjectid=2&forumpage=3 User-Agent:
    > Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
    > Cookie: userloginname=; ASPSESSIONIDCATRATAC=HGBDLENCAPADIEKHFACKMMFK
    > Content-Length: 230 Content-Type: application/x-www-form-urlencoded
    > Accept-Encoding: gzip, deflate Cache-Control: no-cache
    >
    > Header 2
    >
    > Accept: */* Accept-Language: en-nz Connection: Keep-Alive Host: localhost
    > Referer: http://localhost/mysite/page.asp?subjectid=2&forumpage=4
    > User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
    > CLR 1.1.4322) Cookie: userloginname=;
    > ASPSESSIONIDCATRATAC=HGBDLENCAPADIEKHFACKMMFK Accept-Encoding: gzip,
    > deflate
    >
     
    Elie Grouchko, Feb 26, 2006
    #2
    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. Alberto

    Event executed twice

    Alberto, Jan 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    360
    Steve C. Orr [MVP, MCSD]
    Jan 12, 2004
  2. =?Utf-8?B?TWFnZXNo?=
    Replies:
    0
    Views:
    367
    =?Utf-8?B?TWFnZXNo?=
    Aug 25, 2004
  3. Alfons Puig
    Replies:
    0
    Views:
    334
    Alfons Puig
    Jan 5, 2005
  4. Replies:
    0
    Views:
    451
  5. Michael
    Replies:
    0
    Views:
    556
    Michael
    Feb 18, 2004
Loading...

Share This Page