Custom save prompt on unloading page?
<p>I'm working under asp.net and I wonder if is possible to display a custom save prompt (lets say a div with styles, a message and some buttons) when the user is trying to leave the page.<br />
I've seen the onunload and onbeforeunload js events.<br />
The <strong>onunload</strong> event seems to does not work for my purpose, because I display the message but I can't prevent the user leaving the page.<br />
The <b>onbeforunload</b> could be useful just because I can prevent the user leaving the page,  but the prompt is responsability of the navigator, and I want to implement it!</p>

<p>I think there is not another option than <b>onbeforeunload</b> to warn the user about possible losses of work but I expect helpful answers.</p>

<p>Related question: <a href="http://stackoverflow.com/questions/765996/prompting-user-to-save-when-they-leave-a-page">http://stackoverflow.com/questions/765996/prompting-user-to-save-when-they-leave-a-page</a></p>
