ASP.NET 2.0 -- Page_Load called multiple times

Discussion in 'ASP .Net' started by amitku@gmail.com, Apr 1, 2006.

  1. Guest

    I am working on a web site and whenever someone arrives at the home
    page, I'm trying to track this by inserting some values into my
    database.

    I do so from the Page_Load function. Unfortunately for some reason,
    for each person entering my website, I get 3 entries in my database!


    I've been reading everywhere to figure out why this could be happening,

    but I'm out of ideas.


    1) I've made sure that Page.IsPostBack is set to false. No
    improvement.
    2) I also set AutoEventWireup to false, but then my Page_Load function
    wouldn't called at all, so now I've set it back to being true...


    Any ideas or suggestions would be appreciated.


    Thanks in advance,
    Amit
    , Apr 1, 2006
    #1
    1. Advertising

  2. amitku,
    I use the server log because it involves much less coding. Sorry I don't
    know why your getting three hits.

    Good Luck
    DWS


    "" wrote:

    > I am working on a web site and whenever someone arrives at the home
    > page, I'm trying to track this by inserting some values into my
    > database.
    >
    > I do so from the Page_Load function. Unfortunately for some reason,
    > for each person entering my website, I get 3 entries in my database!
    >
    >
    > I've been reading everywhere to figure out why this could be happening,
    >
    > but I'm out of ideas.
    >
    >
    > 1) I've made sure that Page.IsPostBack is set to false. No
    > improvement.
    > 2) I also set AutoEventWireup to false, but then my Page_Load function
    > wouldn't called at all, so now I've set it back to being true...
    >
    >
    > Any ideas or suggestions would be appreciated.
    >
    >
    > Thanks in advance,
    > Amit
    >
    >
    =?Utf-8?B?RFdT?=, Apr 1, 2006
    #2
    1. Advertising

  3. Guest

    I'm doing some additional tracking...the website has a asp parameter
    that I use to track certain other variables, so I can't use the server
    log.

    Anybody out there with any ideas why Page_Load can be called multiple
    times?

    Thanks in advance,
    Amit
    , Apr 3, 2006
    #3
  4. Guest

    It turns out Google Adsense is the reason for the extra calls to
    Page_Load. Removing the adsense code made everything work dandy. But
    this makes no sense to me....does anybody know why this is the case,
    and if so, how can I get around this (besides removing the adsense
    permanently)?

    Thanks in advance,
    Amit
    , Apr 3, 2006
    #4
  5. VickZaro Guest

    use a session variable to detect if you are running the same again

    <> wrote in message
    news:...
    >I am working on a web site and whenever someone arrives at the home
    > page, I'm trying to track this by inserting some values into my
    > database.
    >
    > I do so from the Page_Load function. Unfortunately for some reason,
    > for each person entering my website, I get 3 entries in my database!
    >
    >
    > I've been reading everywhere to figure out why this could be happening,
    >
    > but I'm out of ideas.
    >
    >
    > 1) I've made sure that Page.IsPostBack is set to false. No
    > improvement.
    > 2) I also set AutoEventWireup to false, but then my Page_Load function
    > wouldn't called at all, so now I've set it back to being true...
    >
    >
    > Any ideas or suggestions would be appreciated.
    >
    >
    > Thanks in advance,
    > Amit
    >
    VickZaro, Apr 4, 2006
    #5
    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. George Ter-Saakov

    Page_Load is called 12 times?

    George Ter-Saakov, Dec 2, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    376
    George Birbilis
    Dec 3, 2003
  2. z. f.
    Replies:
    0
    Views:
    551
    z. f.
    Oct 19, 2004
  3. djskrill
    Replies:
    9
    Views:
    691
    djskrill
    Oct 1, 2003
  4. Apricot
    Replies:
    4
    Views:
    516
    velthuijsen
    Apr 16, 2004
  5. Radu
    Replies:
    7
    Views:
    700
    charlie_Stell
    Aug 28, 2009
Loading...

Share This Page