Requirement: I am attempting to alert the user when they leave a page that their changes will be lost.
Problem: I am using webforms and the only solution I have seen to alert the user is using javascript's 'window.onbeforeunload'. This would work great if it didn't fire every time a postback occurred.
Page description: This is a page inherits in a masterpage. The master page is simply a navigation bar with a few hyperlinks. The content page consist of numerous text boxes and a few drop down select boxes.
Question: How do I determine if the javascript event window.onbeforeunload is fired by a postback or not (dirty or not)?
Thank you guys, this is my first question asked. Hopefully I was descriptive enough. I am not allowed to share all of the code due to company policy. Any question I will be happy to answer.