473,701 Members | 2,556 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to detect Browser close event.


Hi,

I have a web Application that must be licensed. When Customer buys 2
licensees for my application they can only have 2 copies open at a time.
What I am doing right now is, I am storing No. Of License in the SQL
Table, and on each connection i would reduce 1 license from the DB. My
problem is when user closes IE Browser, I want to capture this event and
return the license to the DB. How do I know when user closed the
browser? I have more than one page in my application so from any page if
they close browser I should capture that event. I also have Automatic
refresh on couple of pages where it redraws pages from the DB every 5
mins. I should not clear the license upon refresh. I would really
appreciate your help.

Thanks
SM.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
4 29345
There's an event in your global.ascx that triggers when a
session ends. You might want to try updating your DB here.

Sub Session_End(ByV al sender As Object, ByVal e As
EventArgs)
' Fires when the session ends
End Sub
-----Original Message-----

Hi,

I have a web Application that must be licensed. When Customer buys 2licensees for my application they can only have 2 copies open at a time.What I am doing right now is, I am storing No. Of License in the SQLTable, and on each connection i would reduce 1 license from the DB. Myproblem is when user closes IE Browser, I want to capture this event andreturn the license to the DB. How do I know when user closed thebrowser? I have more than one page in my application so from any page ifthey close browser I should capture that event. I also have Automaticrefresh on couple of pages where it redraws pages from the DB every 5mins. I should not clear the license upon refresh. I would reallyappreciate your help.

Thanks
SM.
*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
.

Nov 17 '05 #2
In addition to David replay,

pay attention that the default session ending is 20 minutes after the
user last request to the server, you can change it in the web.config.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
there is no way to reliably catch this event on the server. as the browser
doesn't maintain a connection to your server, you can only guess at number
of concurrent users.

you will need to implement a license checkout scheme. every page request
need to check out a license, that has a short timeout. if none availiable
then report error. on postback the page send the license, if its still vaild
or an additional one is available, the post succeeds, otherwise report out
of license error. the postback will also release the license. if the
postback renders a new page, a new checkout is done.

-- bruce (sqlwork)
"sm mehta" <sh******@hotma il.com> wrote in message
news:eK******** ******@TK2MSFTN GP11.phx.gbl...

Hi,

I have a web Application that must be licensed. When Customer buys 2
licensees for my application they can only have 2 copies open at a time.
What I am doing right now is, I am storing No. Of License in the SQL
Table, and on each connection i would reduce 1 license from the DB. My
problem is when user closes IE Browser, I want to capture this event and
return the license to the DB. How do I know when user closed the
browser? I have more than one page in my application so from any page if
they close browser I should capture that event. I also have Automatic
refresh on couple of pages where it redraws pages from the DB every 5
mins. I should not clear the license upon refresh. I would really
appreciate your help.

Thanks
SM.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #4
You may be able to take advantage of the client side OnClose event.
Here's more info:
http://www.mozilla.org/docs/dom/domr...dow_ref56.html

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"sm mehta" <sh******@hotma il.com> wrote in message
news:eK******** ******@TK2MSFTN GP11.phx.gbl...

Hi,

I have a web Application that must be licensed. When Customer buys 2
licensees for my application they can only have 2 copies open at a time.
What I am doing right now is, I am storing No. Of License in the SQL
Table, and on each connection i would reduce 1 license from the DB. My
problem is when user closes IE Browser, I want to capture this event and
return the license to the DB. How do I know when user closed the
browser? I have more than one page in my application so from any page if
they close browser I should capture that event. I also have Automatic
refresh on couple of pages where it redraws pages from the DB every 5
mins. I should not clear the license upon refresh. I would really
appreciate your help.

Thanks
SM.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
5232
by: hb | last post by:
Hi, Would you please tell me how to detect if the client's browser is closed? I need such event to trigger a database modification. Thank you hb
3
4260
by: Lord2702 | last post by:
Sat. Oct. 30, 2004 3:25 PM PT I want to detect, if user has close the browser, (after logging to my site), that user has closed the browser. How to achieve it ? I want to know this close action on my server-side code. Because if he logout by clicking on Logout/ Sign-Off button it simple to get the message. Although, this is very similar to the first above. Also, if user takes any action on client-side or browser side how will I detect...
8
17374
by: Luke Matuszewski | last post by:
I have read all posts about how to detect that url have changed to new page and trigger the event handler then eg. function aidLogout(evt) { if(evt) { /* maybe via analyse of evt object i can detect the close of the browser window */ } if(window.event) { /* maybe via analyse of window.event object i can detect the close of the browser window */
7
4982
by: tarun.kataria | last post by:
Hi All, Is there any way to detect that the user is trying to Xout the browser window instead of hitting a button. Because in my application I want to make it sure that they dont do it either knowingly or accidently. Its an ASP.NET application with C#. Thanks Tarun
1
4729
by: bloodandrose | last post by:
Can you help me How to detect browser close event? Thanks
1
33177
by: nebulus | last post by:
I'm working on a web app that under normal circumstances will be happy with the Session_OnEnd event, but when a user leaves a page by closing the browser by either Alt+F4 or just hitting the "X", I'll need to kill the session. Now, with the onbeforeunload event, I can handle this quite easily in IE, but in FireFox, it's another matter. For one thing, FireFox seems to empty out its event object on a page unload, so it's very hard to track...
1
2475
by: mark4asp | last post by:
<!-- // How to detect the rendering mode which the browser is currently in (works for IE6). // Ctrl+Shift+s displays indicates whether the browser is in quirks or standards mode. // Detect keypress var captureKeys = function(ev) { ev = ev || window.event; // gets the event in ie or ns kCode = ev.keyCode || ev.which; // gets the keycode in ie or ns
11
4125
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi misters, I have an aplication web asp.net 2.0 and I am Trying to detect the close event in browser, which is the best performance for do this ? What's up with Alt+F4, Refresh, user clicks X, etc ? Thanks. -- http://www.alhambra-eidos.es/web2005/index.html www.kiquenet.net
0
8736
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9229
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9083
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8977
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8934
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7824
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2035
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.