Event that handle "close browser"

Discussion in 'ASP .Net' started by Metallica, Sep 21, 2004.

  1. Metallica

    Metallica Guest

    Hi,

    i made a log system that register when the user logs in and out.

    I want know wich event is responsable to catch when the user closes the
    browser...

    i try page_unload event on my pages, but when use the system, it logs every
    page that i passed, i my goal is to log when the user closes the browser.

    any ideias?
     
    Metallica, Sep 21, 2004
    #1
    1. Advertising

  2. Metallica

    i. Wiin Guest

    Session_End section in the global.asax file is what should be used. But it
    is flakey and doesn't capture every closing of browser or end of session.
    Good luck.

    "Metallica" <> wrote in message
    news:...
    > Hi,
    >
    > i made a log system that register when the user logs in and out.
    >
    > I want know wich event is responsable to catch when the user closes the
    > browser...
    >
    > i try page_unload event on my pages, but when use the system, it logs

    every
    > page that i passed, i my goal is to log when the user closes the browser.
    >
    > any ideias?
    >
    >
     
    i. Wiin, Sep 21, 2004
    #2
    1. Advertising

  3. Metallica

    bruce barker Guest

    there is no server (code-behind) event for browser close, as the browser
    does not inform the user. this is why sessions time out.

    -- bruce (sqlwork.com)


    "Metallica" <> wrote in message
    news:...
    > Hi,
    >
    > i made a log system that register when the user logs in and out.
    >
    > I want know wich event is responsable to catch when the user closes the
    > browser...
    >
    > i try page_unload event on my pages, but when use the system, it logs

    every
    > page that i passed, i my goal is to log when the user closes the browser.
    >
    > any ideias?
    >
    >
     
    bruce barker, Sep 21, 2004
    #3
  4. Metallica

    i. Wiin Guest

    Bruse is correct. There is no way to capture the exact time the user closes
    their local browser. So you'll have to wait for the session to expire and
    capture it using session_end

    If you absolutely MUST capture when the user closes the app, then you'll
    have to build your web app an ActiveX or a Java applet (involves a lot of
    work). Both of these should give you the ability to pass info back to the
    server upon closing of the app by the end-user.

    Good luck.


    "bruce barker" <> wrote in message
    news:...
    > there is no server (code-behind) event for browser close, as the browser
    > does not inform the user. this is why sessions time out.
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Metallica" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > i made a log system that register when the user logs in and out.
    > >
    > > I want know wich event is responsable to catch when the user closes the
    > > browser...
    > >
    > > i try page_unload event on my pages, but when use the system, it logs

    > every
    > > page that i passed, i my goal is to log when the user closes the

    browser.
    > >
    > > any ideias?
    > >
    > >

    >
    >
     
    i. Wiin, Sep 21, 2004
    #4
  5. You may be able to take advantage of the client side OnClose event.
    Here's more info:
    http://www.mozilla.org/docs/dom/domref/dom_window_ref56.html

    BTW, Metallica rocks.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://Steve.Orr.net


    "Metallica" <> wrote in message
    news:...
    > Hi,
    >
    > i made a log system that register when the user logs in and out.
    >
    > I want know wich event is responsable to catch when the user closes the
    > browser...
    >
    > i try page_unload event on my pages, but when use the system, it logs
    > every page that i passed, i my goal is to log when the user closes the
    > browser.
    >
    > any ideias?
    >
     
    Steve C. Orr [MVP, MCSD], Sep 21, 2004
    #5
  6. Metallica

    bruce barker Guest

    a java applet won't work, and the active/x control would have to a browser
    helper object.

    -- bruce (sqlwork.com)

    "i. Wiin" <> wrote in message
    news:...
    > Bruse is correct. There is no way to capture the exact time the user

    closes
    > their local browser. So you'll have to wait for the session to expire and
    > capture it using session_end
    >
    > If you absolutely MUST capture when the user closes the app, then you'll
    > have to build your web app an ActiveX or a Java applet (involves a lot of
    > work). Both of these should give you the ability to pass info back to the
    > server upon closing of the app by the end-user.
    >
    > Good luck.
    >
    >
    > "bruce barker" <> wrote in message
    > news:...
    > > there is no server (code-behind) event for browser close, as the browser
    > > does not inform the user. this is why sessions time out.
    > >
    > > -- bruce (sqlwork.com)
    > >
    > >
    > > "Metallica" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > i made a log system that register when the user logs in and out.
    > > >
    > > > I want know wich event is responsable to catch when the user closes

    the
    > > > browser...
    > > >
    > > > i try page_unload event on my pages, but when use the system, it logs

    > > every
    > > > page that i passed, i my goal is to log when the user closes the

    > browser.
    > > >
    > > > any ideias?
    > > >
    > > >

    > >
    > >

    >
    >
     
    bruce barker, Sep 22, 2004
    #6
  7. Metallica

    Metallica Guest

    Thks Steve, i will try this.

    :)

    ps: Metallica really rocks here in brasil too!
    :)


    "Steve C. Orr [MVP, MCSD]" <> wrote in message
    news:...
    > You may be able to take advantage of the client side OnClose event.
    > Here's more info:
    > http://www.mozilla.org/docs/dom/domref/dom_window_ref56.html
    >
    > BTW, Metallica rocks.
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD, MVP
    > http://Steve.Orr.net
    >
    >
    > "Metallica" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> i made a log system that register when the user logs in and out.
    >>
    >> I want know wich event is responsable to catch when the user closes the
    >> browser...
    >>
    >> i try page_unload event on my pages, but when use the system, it logs
    >> every page that i passed, i my goal is to log when the user closes the
    >> browser.
    >>
    >> any ideias?
    >>

    >
    >
     
    Metallica, Sep 22, 2004
    #7
    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. Dietrich
    Replies:
    1
    Views:
    648
    Joe Smith
    Jul 22, 2004
  2. Jerry III
    Replies:
    2
    Views:
    605
    Kathy Burke
    Aug 3, 2003
  3. JerryG
    Replies:
    0
    Views:
    427
    JerryG
    Dec 20, 2005
  4. Leon
    Replies:
    2
    Views:
    535
  5. =?ISO-8859-1?Q?KLEIN_St=E9phane?=
    Replies:
    3
    Views:
    454
    hanumizzle
    Oct 6, 2006
Loading...

Share This Page