Current location: Hot Scripts Forums » Programming Languages » ASP.NET » browser close event?


browser close event?

Reply
  #1 (permalink)  
Old 09-30-06, 07:06 AM
daivagna daivagna is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Question browser close event?

hey guyz..i m devloping an application in asp.net and i have taken sessions to keep track of how many user are online...so in session_start i am increasing the value of Application variable by one now when user logges out i have called session_end by abendoning the session but what if some one closes browser directly..how to catch that event.when some 1 clicks 'X' button of browser..coz i wanna close the session in that event..help me
Reply With Quote
  #2 (permalink)  
Old 09-30-06, 07:26 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Topic moved to ASP.NET.
Reply With Quote
  #3 (permalink)  
Old 09-30-06, 07:40 AM
raji20 raji20 is offline
Newbie Coder
 
Join Date: Aug 2006
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
javascript "onUnload" function will help to capture the close event of the window.
Reply With Quote
  #4 (permalink)  
Old 10-01-06, 02:43 AM
daivagna daivagna is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
ononload problem

thxs for ur comments but ononload is firing even if somebody refrashes the page...hey i tried for window.close() mathod..with that it is asking for YES or NO..whether u wanna close browser or not but how to get which button user has clicked.. can i knw?in some variable or something????
Reply With Quote
  #5 (permalink)  
Old 10-01-06, 07:50 AM
koncept
Guest
 
Posts: n/a
i will assume you are running everything in a global.asax file if so, this may be of some help - http://www.dotnethero.com/hero/appli...x.aspx?nmx=5_2. I am not aware of an event that will subtract them when they close the window, I always assumed it was captured in the session_end but at the same time i never bothered with current user counters so i could be wrong
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
redirect - firefox browser chrisrobertson JavaScript 3 05-12-06 05:37 PM
How to disable close button in a window cheenu1979 JavaScript 2 03-22-05 01:23 PM
Browser : Back, Forward & Close RaceWorks JavaScript 1 11-16-04 03:59 PM
Session or anything else require close window event? webFani PHP 2 04-14-04 11:43 PM
Confirm on close? Icarus JavaScript 6 01-31-04 05:59 PM


All times are GMT -5. The time now is 01:15 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.