That event is the only way. You have to keep track in your page whether or
not the user just did something that would cause a postback and only show
the message if the user did not just do something to interact with your
page.
"sylvain" <sy*****@discussions.microsoft.comwrote in message
news:93**********************************@microsof t.com...
is there a simple way to detect a web window closing when the user hit the
X
of the browser ? I want to display a message to the user when he goes out
of
my web page.
I try to detect it by using the event window.unbeforeunload but this event
is fire when the page is postback...