count visits

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alberto

    #1

    count visits

    I'd like to count the number of visits of my page so I need find out an
    event raised only when the app starts. I think this could be the
    Session_OnStart but I don't know whats the object who send it.

    Thank you.


  • Alvin Bruney

    #2
    Re: count visits

    No that doesn't happen when the application starts. It happens when the
    session starts. Put a counter variable in there and increment it. It will
    need to be stateful, that is it needs to remember the value. You can find
    the session_start event in the global.asax.x file.

    regards

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Alberto" <alberto@nospam .es> wrote in message
    news:epi5g1vnDH A.2536@tk2msftn gp13.phx.gbl...[color=blue]
    > I'd like to count the number of visits of my page so I need find out an
    > event raised only when the app starts. I think this could be the
    > Session_OnStart but I don't know whats the object who send it.
    >
    > Thank you.
    >
    >[/color]


    Comment

    • Alberto

      #3
      Re: count visits

      Could you tell me how to find it?
      Actually I see the Global.asax and the Global.asax.cs. In the Global.asax.cs
      I can see this events:
      acquireRequestS tate
      AuthenticatedRe quest
      BeginRequest
      Disposed
      Elapsed
      EndRequest
      Error
      PostRequestHand lerExecute
      PreRequestHandl erExecute
      PreSendRequestC ontent
      PreSendRequestH eaders
      ReleaseRequestS tate
      ResolvedRequest Cache
      UpdateRequestCa che

      Thank you for your help
      "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> escribió en
      el mensaje news:uroJ2xwnDH A.2628@TK2MSFTN GP10.phx.gbl...[color=blue]
      > No that doesn't happen when the application starts. It happens when the
      > session starts. Put a counter variable in there and increment it. It will
      > need to be stateful, that is it needs to remember the value. You can find
      > the session_start event in the global.asax.x file.
      >
      > regards
      >
      > --
      >
      >
      > -----------
      > Got TidBits?
      > Get it here: www.networkip.net/tidbits
      > "Alberto" <alberto@nospam .es> wrote in message
      > news:epi5g1vnDH A.2536@tk2msftn gp13.phx.gbl...[color=green]
      > > I'd like to count the number of visits of my page so I need find out an
      > > event raised only when the app starts. I think this could be the
      > > Session_OnStart but I don't know whats the object who send it.
      > >
      > > Thank you.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Scott M.

        #4
        Re: count visits

        Look in Global.aspx for Session_Start() . In addition to storing your
        counter in some statefull way, you'll also need to store it in some long
        term way (for when you have to re-boot the server for whatever reason).
        I've found that saving the hit count in an Application variable
        (incrementing it in the Session_Start) and storing the latest value in a
        counter file on the server works well. It does mean that in the
        Application_Sta rt event of Global.aspx, you need to read that file and set
        the Application variable to the value in that file.




        "Alberto" <alberto@nospam .es> wrote in message
        news:OhPSU2wnDH A.1072@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Could you tell me how to find it?
        > Actually I see the Global.asax and the Global.asax.cs. In the[/color]
        Global.asax.cs[color=blue]
        > I can see this events:
        > acquireRequestS tate
        > AuthenticatedRe quest
        > BeginRequest
        > Disposed
        > Elapsed
        > EndRequest
        > Error
        > PostRequestHand lerExecute
        > PreRequestHandl erExecute
        > PreSendRequestC ontent
        > PreSendRequestH eaders
        > ReleaseRequestS tate
        > ResolvedRequest Cache
        > UpdateRequestCa che
        >
        > Thank you for your help
        > "Alvin Bruney" <vapordan_spam_ me_not@hotmail_ no_spamhotmail. com> escribió[/color]
        en[color=blue]
        > el mensaje news:uroJ2xwnDH A.2628@TK2MSFTN GP10.phx.gbl...[color=green]
        > > No that doesn't happen when the application starts. It happens when the
        > > session starts. Put a counter variable in there and increment it. It[/color][/color]
        will[color=blue][color=green]
        > > need to be stateful, that is it needs to remember the value. You can[/color][/color]
        find[color=blue][color=green]
        > > the session_start event in the global.asax.x file.
        > >
        > > regards
        > >
        > > --
        > >
        > >
        > > -----------
        > > Got TidBits?
        > > Get it here: www.networkip.net/tidbits
        > > "Alberto" <alberto@nospam .es> wrote in message
        > > news:epi5g1vnDH A.2536@tk2msftn gp13.phx.gbl...[color=darkred]
        > > > I'd like to count the number of visits of my page so I need find out[/color][/color][/color]
        an[color=blue][color=green][color=darkred]
        > > > event raised only when the app starts. I think this could be the
        > > > Session_OnStart but I don't know whats the object who send it.
        > > >
        > > > Thank you.
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...