ASP.NET 2.0 -- Page_Load called multiple times

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

  1. amitku

    amitku 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
     
    amitku, Apr 1, 2006
    #1
    1. Advertisements

  2. amitku

    Guest Guest

    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
     
    Guest, Apr 1, 2006
    #2
    1. Advertisements

  3. amitku

    amitku 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
     
    amitku, Apr 3, 2006
    #3
  4. amitku

    amitku 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
     
    amitku, Apr 3, 2006
    #4
  5. amitku

    VickZaro Guest

    use a session variable to detect if you are running the same again
     
    VickZaro, Apr 4, 2006
    #5
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.