Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

How to trap the click event of the browser window's "x" button?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Feng - 28 Oct 2005 22:33 GMT
Hi,

In our ASP.Net app, we need to do some backend house keeping job when a user
is about to end his/her session. We do have an "Logoff" button designed for
this purpose and we have been telling our client to always exit using this
button. When they exit this way, our server logic will make contact with the
backend and clean things up before the session goes out.

Our problem is, however, that since people are so used to clicking on the
"x" button on the upper right corner of the browser window and exit, we are
facing the problem of hanging backend processes all the time.

What I think we need is somehow capter the click event of the "x" button and
invoke the some logic that our "Logoff" button does. But this doesn't seem to
be an easy thing to do. Can someone shed some light on this one in terms of
how we should approach this? Some example would be even better.

Thanks a lot!

Feng
//Rutger Smit - 28 Oct 2005 23:48 GMT
Hook up on the window.onclose event in JavaScript, that will be the only
way.

Cheers,
//Rutger

http://www.RutgerSmit.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.