Hi,
I would like to do some server side actions while closing the browser
window. I tried with Page_Unload event, but it triggers while loading
the page itself. Anyone please tell me is there any event that triggers
on closing the page? 7 4401
No, there is no. You can try handling client-side window.onunload event to
pass something to the server.
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Santel" <sa***********@sify.comwrote in message
news:11********************@i15g2000cwa.googlegrou ps.com...
Hi,
I would like to do some server side actions while closing the browser
window. I tried with Page_Unload event, but it triggers while loading
the page itself. Anyone please tell me is there any event that triggers
on closing the page?
You pretty much need to hook into a javascript event (like onbeforeunload),
and fire some server side code - either be poping up a window or doing some
ajax.
Karl
-- http://www.openmymind.net/ http://www.codebetter.com/
"Santel" <sa***********@sify.comwrote in message
news:11********************@i15g2000cwa.googlegrou ps.com...
Hi,
I would like to do some server side actions while closing the browser
window. I tried with Page_Unload event, but it triggers while loading
the page itself. Anyone please tell me is there any event that triggers
on closing the page?
"Santel" <sa***********@sify.comwrote in message
news:11********************@i15g2000cwa.googlegrou ps.com...
I would like to do some server side actions while closing the browser
window. I tried with Page_Unload event, but it triggers while loading
the page itself. Anyone please tell me is there any event that triggers
on closing the page?
As Eliyahu says, you can (try to) use the window.unload event, but the
problem here is that not all browsers handle this event in the same way, and
it will (sometimes) fire if the user clicks the Refresh button, which will
probably cause a lot more problems for you...
What are you trying to achieve with this...?
"Karl Seguin" <ka********@removeopenmymindremovemetoo.andmenetwr ote in
message news:u6**************@TK2MSFTNGP03.phx.gbl...
You pretty much need to hook into a javascript event (like
onbeforeunload),
The problem here is that onbeforeunload is not (currently) standard w3c, and
is not supported in all browsers: http://forums.asp.net/thread/1362515.aspx
Hi Mark,
Mark Rae wrote:
As Eliyahu says, you can (try to) use the window.unload event, but the
problem here is that not all browsers handle this event in the same way, and
it will (sometimes) fire if the user clicks the Refresh button, which will
probably cause a lot more problems for you...
Out of curiosity, in your experience, which browsers do not fire
window.unload when the page is refreshed?
Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:uX**************@TK2MSFTNGP02.phx.gbl...
>As Eliyahu says, you can (try to) use the window.unload event, but the problem here is that not all browsers handle this event in the same way, and it will (sometimes) fire if the user clicks the Refresh button, which will probably cause a lot more problems for you...
Out of curiosity, in your experience, which browsers do not fire
window.unload when the page is refreshed?
Safari certainly didn't, though I haven't checked in the latest version...
Hi,
Mark Rae wrote:
"Laurent Bugnion [MVP]" <ga*********@bluewin.chwrote in message
news:uX**************@TK2MSFTNGP02.phx.gbl...
>>As Eliyahu says, you can (try to) use the window.unload event, but the problem here is that not all browsers handle this event in the same way, and it will (sometimes) fire if the user clicks the Refresh button, which will probably cause a lot more problems for you...
Out of curiosity, in your experience, which browsers do not fire window.unload when the page is refreshed?
Safari certainly didn't, though I haven't checked in the latest version...
Interesting. Thanks! That confirms what I thought, that this event is
not reliable.
Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: HarveyB |
last post by:
I would like to generate non-modal popup windows from
ASP.Net code-behind. I have tried using Client Side
scripting like "function Test(){
window.open('test.htm',_blank,...
|
by: Solvig |
last post by:
Server side and client side actions on one button in ASP.NET
I am stuck. How do I find a start to a solution.
After checking all fields in a form I want to save changes in the database,
open a...
|
by: feng |
last post by:
Hi,
When user closes a browser window by clicking on the "X"
button, I want the server to be noticed (either through
postback or calling other ASP pages, etc.) and perform
some task...
|
by: Teckie03 |
last post by:
Hi, does anyone know how to display a seperate browser
from server process?
My ASP.NET app control (ascx) has Archive button that does
its own work , including updating an html page
called...
|
by: Sileesh |
last post by:
Hi
I hope some one has an answer to this.
I have a button in an aspx page . On server click of this button, i perform
some operation. Once the operation is performed i want to close this...
|
by: Kash |
last post by:
Hi everybody:
I've developed a web application running on a 2003 server not on the web but
on extranet environment of a small Firm (less than 10 users). I've taken
benefit of Office Primary...
|
by: genc ymeri |
last post by:
Is anyway I can catch the event of client closing the browser in server side
(ASP.Net) ???
Thanks in advance,
Genc Ymeri.
|
by: Jobs |
last post by:
Download the JAVA , .NET and SQL Server interview with answers
Download the JAVA , .NET and SQL Server interview sheet and rate
yourself. This will help you judge yourself are you really worth of...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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,...
|
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...
|
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: 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...
| |