On StackOverflow when you're asking a new question, you have enter the question and if you decide to navigate away from the page you get an "Are you sure" confirmation.
I'd like to do the same in my ASP.Net application:
The user has to fill in a questionnaire and has the option to store his answers temporarely. If the user decides to navigate away from the page without temporarely storing his answers we'd like a confirmation to popup and ask the user to store his answers.
Two questions:
What's a decent way of showing the confirmation popup before the page unloads in ASP.Net?
I'm aware of the beforeunload event, but I don't want to make it one big javascript hack.I don't want the confirmation to kick in when the user clicks the Save button (which is saving the answers anyway)