"Weston Weems" <an*******@discussions.microsoft.com> wrote in message
news:62****************************@phx.gbl...
Ok,
what I am attempting to do is take a web form and attach a
confirm to leave page. I can get the event to fire (though
it doestn actually prevent navigating away from the site)
My problem is that every time I initiate a postback, the
event is also fired. I dont want people to see "Are you
sure you wish to discard any changes?" if they hit refresh
or postback etc.
ANyway I can get around this?
You can't really do this. Remember that by the time the client sees the web
page, the code has finished on the server. Once the page has been sent to
the client, the server has no further connection to the client, and cannot
know when the client closes his browser.
All of this sort of thing has to be done on the client, in script.
John Saunders