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

  • Thread starter Thread starter Chirag Malvi
  • Start date Start date
C

Chirag Malvi

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,

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
(e-mail address removed)

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


--------------------
 
Back
Top