473,385 Members | 1,506 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,385 software developers and data experts.

Page Close Event with ASP.NET



I have a ASP.NET web app, and I can't find and event like "OnClose()" . But I need to know when the page is closed because I have to much to do when this happen...

Thanx in Advantage....
Nov 15 '05 #1
3 11115
You'll need to write a clientside javascript that that handles the
"onunload" method to catch the event of the user navigating or closing the
browser (etc.. many things trigger this event - check the docs). But you'll
never have a guarantee that the method will actually be called - it depends
on the securitysettings etc of the client's browser. If the client has
disabled scripts - naturally it won't run.

But, WHY do you need to know when the user navigates away from a page? You
could probably solve this another way.
Arild

"Hector Martinez" <an*******@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...


I have a ASP.NET web app, and I can't find and event like "OnClose()" . But I need to know when the page is closed because I have to much to do when
this happen...
Thanx in Advantage....

Nov 15 '05 #2

I'm making something like a chat, and I need to delete a user when he get out...
Is any better solution for that?
Nov 15 '05 #3
Yes.

Do not rely on this.

Have the user call in regularly, and when he does not report in for some
time, kill him.

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET)
(CTO PowerNodes Ltd.)

"Hector Martinez" <an*******@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...

I'm making something like a chat, and I need to delete a user when he get out...

Is any better solution for that?

Nov 15 '05 #4

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

Similar topics

4
by: Fabrizio | last post by:
I've this problem. I need, when the user close the web page, to show a message of confirm with Ok and cancel. With the event unload when I click cancel the web page closes however. What can I do...
4
by: KS | last post by:
Is it possible to write a javascript that makes a popup window when someone click on buttons/href on my page and close itself when the new page is about to get loaded? I want to prevent the user...
4
by: Vincent Yang | last post by:
I'm using Access 2002. My database is in Access 2000 format. I'm designing a form to collect responses to a 40-item questionnaire. I can fit four list boxes on a screen, so I plan to have 11 tab...
1
by: JezB | last post by:
1) How can I force page closure from server side c# code ? (eg. on my own Close button event). 2) I want to do some session variable cleanup when the user is finished with my page. Where is the...
9
by: Daniel Walzenbach | last post by:
Hi I am faced with the following problem: I have a page (let’s call this page page1.aspx) containing some TextBoxes and a hyperlink which opens another page (let’s call this page page2.aspx)...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
1
by: =?Utf-8?B?Q2hyaXNB?= | last post by:
Two questions: 1. I have several asp.net pages that initiate a file download, via Response.WriteFile(). This works fine, except that it leaves the original page up. These pages are generally...
9
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in a...
0
by: Bali | last post by:
Default.aspx is the starting page containing a control(ascx) which has asp:button control on it. On the button click event it has to open a new page as a modal control. Since refreshing a page in...
5
by: =?Utf-8?B?U3RldmVuIFRhbmc=?= | last post by:
It seems that one page XBAP whose Unloaded event never get called, I need put some clearing stuff (I.G stop dispatcher time) when user close browser, it unload event doesn't work, where shall I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.