OnClose window event

K

Kamyk

Hello all!

Does it exist an event OnCloseWindow (I mean something like
OnCloseInternetExplorerWindow) which let me call and run a function who will
change value one of the record field of MS SQL Server Database from "1" to
"0" after clicking on "x" in this window?

Thanx for posts
Marcin from Poland
 
D

David Dorward

Kamyk said:
Does it exist an event OnCloseWindow (I mean something like
OnCloseInternetExplorerWindow) which let me call and run a function who
will change value one of the record field of MS SQL Server Database from
"1" to "0" after clicking on "x" in this window?

No. There is the non-standard onbeforeunload, but I don't believe you can
use it to send server requests (as the window goes away and there isn't
anything to receive the response).

It sounds like you are trying to implement a log out system, but even if the
above could work, it wouldn't deal with the user disconnecting from the
network, or turning their computer off.

Accept that HTTP is stateless, and have your login sessions time out after a
period of inactivity (which is what everyone else does).
 
T

Travis Newbury

David said:
Accept that HTTP is stateless, and have your login sessions time out after a
period of inactivity (which is what everyone else does).

Everyone but SCORM (the learning content standard). They (try) to use
a close window event. But they are more a Web application than a web site.
 
K

Kamyk

Uzytkownik "David Dorward said:
No. There is the non-standard onbeforeunload, but I don't believe you can
use it to send server requests (as the window goes away and there isn't
anything to receive the response).

It sounds like you are trying to implement a log out system, but even if the
above could work, it wouldn't deal with the user disconnecting from the
network, or turning their computer off.

Yes I want to create something like logging out system, because if someboedy
close the window by clicking on "x" in web browser, the record is still
blocked
by this person, and nobody except form this person, has any access to this
record.
That`s why I need to find out how to implement a function which will be
called
after clicking "x" in the web browser and then the record field value will
be changed
from "1" into "0".
Accept that HTTP is stateless, and have your login sessions time out after a
period of inactivity (which is what everyone else does).

Marcin
 
D

David Dorward

Kamyk said:
That`s why I need to find out how to implement a function which will be
called after clicking "x" in the web browser and then the record field
value will be changed from "1" into "0".

The post you quoted explained that that is impossible and suggested
alternatives.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top