Urgent...trapping User's Browser closing event....

Discussion in 'ASP .Net' started by Chirag Malvi, Nov 11, 2003.

  1. Chirag Malvi

    Chirag Malvi Guest

    hello all,

    I am developing the web application using ASP.net and VS.2003 IDE.

    here is the situation which i want to implement.

    1) User is browsing some webform. I want to trap this event. this i am doing
    with Session_Onstart.
    2) Now when user is exiting i.e. closing the browser window i want to trap
    this event and perform some operation. I tried using Session_OnEnd event,but
    this event will get generated when time out of the session occurs or when
    the session is abandon by the application. hence it is not serving my
    purpose.

    can any body help me in trapping the user's browser closing event or with
    any other options??

    thanks in advance

    regards
    chirag
    Chirag Malvi, Nov 11, 2003
    #1
    1. Advertising

  2. Chirag,

    You will need to handle that on the client, not in your server-side ASP.NET
    code. ASP.NET operates over HTTP, and HTTP is a connectionless protocol.
    Your ASP.NET application has no knowledge whatever of the client machine.
    Client-side events such as the browser window closing cannot be handled on
    the server.

    I'm not aware of a client-side event that will handle the closing of the
    browser window, but there may be some in the group who are better versed on
    client side code than I am. I don't deal much with client side code in my
    position.

    Jim Cheshire [MSFT]
    Developer Support
    ASP.NET


    This post is provided as-is with no warranties and confers no rights.


    --------------------
    >From: "Chirag Malvi" <>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet
    >Subject: Urgent...trapping User's Browser closing event....
    >Date: Tue, 11 Nov 2003 19:04:50 +0530
    >Organization: RBIN
    >Lines: 23
    >Sender: UNKNOWN@173.148.9.199
    >Message-ID: <boqohv$9jt$>
    >NNTP-Posting-Host: 173.148.9.199
    >X-Trace: ns2.fe.internet.bosch.com 1068557695 9853 173.148.9.199 (11 Nov

    2003 13:34:55 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: 11 Nov 2003 13:34:55 GMT
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
    >X-MSMail-Priority: Normal
    >X-Priority: 3
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
    >Path:

    cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.co
    m!newsfeed.icl.net!newsfeed.fjserv.net!feed.news.nacamar.de!news.f.de.plusli
    ne.net!news-fra1.dfn.de!news0.de.colt.net!news1.boschrexroth.de!news1.fe.int
    ernet.bosch.com!not-for-mail
    >Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:190011
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    >
    >hello all,
    >
    >I am developing the web application using ASP.net and VS.2003 IDE.
    >
    >here is the situation which i want to implement.
    >
    >1) User is browsing some webform. I want to trap this event. this i am

    doing
    >with Session_Onstart.
    >2) Now when user is exiting i.e. closing the browser window i want to trap
    >this event and perform some operation. I tried using Session_OnEnd

    event,but
    >this event will get generated when time out of the session occurs or when
    >the session is abandon by the application. hence it is not serving my
    >purpose.
    >
    >can any body help me in trapping the user's browser closing event or with
    >any other options??
    >
    >thanks in advance
    >
    >regards
    >chirag
    >
    >
    >
    Jim Cheshire [MSFT], Nov 11, 2003
    #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. =B=
    Replies:
    3
    Views:
    3,836
  2. genc ymeri
    Replies:
    5
    Views:
    554
  3. Replies:
    1
    Views:
    339
    =?Utf-8?B?U2F6aWQgS2hhbg==?=
    Aug 27, 2006
  4. karthik juneni
    Replies:
    1
    Views:
    225
    Anthony Jones
    Mar 30, 2007
  5. Derek
    Replies:
    2
    Views:
    113
Loading...

Share This Page