ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
Go Back  Xtreme Visual Basic Talk > > > ASP.NET with VB.NET Page Close Event


Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2006, 04:41 AM
Eduardo Lorenzo's Avatar
Eduardo Lorenzo Eduardo Lorenzo is offline
Senior Contributor
 
Join Date: Jun 2006
Location: Manila, Philippines
Posts: 846
Default


Quote:
Originally Posted by wayneph
The page closing is a client side event, so there isn't an ASP.NET event for it.

There is an onunload that you can put into the body tag, but it would be a JavaScript event. I've seen apps that popup a small window to call a server side page that cleans up sessions if someone closes the browser.
where? please post the link. I am having problems like this. When the user uses the X button to close the browser, my pageClosing function is not called so the user is not logged-off.
Reply With Quote
  #2  
Old 11-08-2006, 07:29 AM
wayneph's Avatar
waynephASP.NET with VB.NET Page Close Event wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

Actually, I saw it as part of a Crystal Reports environment a few years ago. I don't have a link for anything. You'll have to do some searching on google.

The problem with using onunload is that it runs every time the user changes pages, so you have to be careful that they are really closing the browser
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #3  
Old 11-13-2006, 04:54 PM
Eduardo Lorenzo's Avatar
Eduardo Lorenzo Eduardo Lorenzo is offline
Senior Contributor
 
Join Date: Jun 2006
Location: Manila, Philippines
Posts: 846
Default

Quote:
Originally Posted by wayneph
Actually, I saw it as part of a Crystal Reports environment a few years ago. I don't have a link for anything. You'll have to do some searching on google.

The problem with using onunload is that it runs every time the user changes pages, so you have to be careful that they are really closing the browser
I have had some success in my search for the solution but I ended up using a third-party control. I won't advertise it here.

am trying to create one that I can share here but I am a bit confused with the "onunload" event and when this actually happens.

Is the unload event "after" the server has "released" all the data/components/objects that the browser needs to construct the page? Or is it after the browser has destroyed the page?
Reply With Quote
  #4  
Old 11-14-2006, 03:48 PM
wayneph's Avatar
waynephASP.NET with VB.NET Page Close Event wayneph is offline
Web Junkie

Retired Moderator
* Expert *
 
Join Date: Apr 2004
Location: D/FW, Texas, USA
Posts: 8,393
Default

we may be talking about different things here. i'm talking about the browser event, not the server event. once the page is rendered and sent to the client, then there is nothing on the server. (with the exception of session variables...)
__________________
-- wayne, MSSM Retired
> SELECT * FROM users WHERE clue > 0
0 rows returned
Reply With Quote
  #5  
Old 11-14-2006, 04:31 PM
Eduardo Lorenzo's Avatar
Eduardo Lorenzo Eduardo Lorenzo is offline
Senior Contributor
 
Join Date: Jun 2006
Location: Manila, Philippines
Posts: 846
Default

Quote:
Originally Posted by wayneph
we may be talking about different things here. i'm talking about the browser event, not the server event. once the page is rendered and sent to the client, then there is nothing on the server. (with the exception of session variables...)
ok.. well my problem was also on the page unload..

when the user closes the page using the file-close command of the browser OR the X on the upper right hand corner of the browser OR the close from clicking the "e" logo in the upper left hand corner OR pressing Alt-F4, the application closes without going to a function that I have added resulting in the user still being logged on and a whole lot of other processes (including garbage collection) not being done..
Reply With Quote
  #6  
Old 12-07-2006, 01:29 AM
Eduardo Lorenzo's Avatar
Eduardo Lorenzo Eduardo Lorenzo is offline
Senior Contributor
 
Join Date: Jun 2006
Location: Manila, Philippines
Posts: 846
Default

this is part of what I did..

Code:
<script language="javascript">
function wrongClick()
{
var abssize = document.body.offsetWidth-30;
if((event.clientY < 0 && event.clientX >= abssize) || (event.clientY < 0 &&
event.clientX >= 0))
{
window.open("logmeout.aspx", "_blank");
}
}
</script>
where logmeout.aspx is a blank page that contains the code to log-out a user "with force"

and then add this

Code:
<body onbeforeunload="wrongCLick()">
__________________
Pinoy ako.. ipinagmamalaki ko.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
 
ASP.NET with VB.NET Page Close Event
ASP.NET with VB.NET Page Close Event
 
-->