There's no great solution. The only way is to hook into some javascript
events such as OnBeforeUnload which tend to be IE only.
<body OnBeforeUnload="Cleanup();">
<Script langauge="javascript">
function Cleanup()
{
//do stuff
}
</script>
of course, if you need to do stuff server side, you'll have to have
Cleanup() either launch a small popup which you can then do stuff in
Page_load or use AJax to make an asynch request.
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"louise raisbeck" <lo************@discussions.microsoft.com> wrote in
message news:DE**********************************@microsof t.com...
Hi there,
i need to ensure a user does something when they exit an asp.net web page.
I
cant put code behind close buttons, because there are a thousand ways they
can exit this page, menu buttons, links etc. Is there any way you can
capture
the exiting of a page/the moment the server receives a request to move
away
from a particular url ? Page_Unload, although it sounds ideal, actually
doesnt capture the unload of a page, but the moment that load finishes!
Has
anyone needed to do this, and if so, how?
I'm working in C#.
many thanks in advance.