473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 29297
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(ByVal 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******@hotmail.com> wrote in message
news:eK**************@TK2MSFTNGP11.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******@hotmail.com> wrote in message
news:eK**************@TK2MSFTNGP11.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
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
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...
8
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...
7
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...
1
by: bloodandrose | last post by:
Can you help me How to detect browser close event? Thanks
1
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",...
1
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...
11
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,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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,...

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.