Ok, for this requirements, ou can consider the following points.
1. Implement OnKeyPress and OnKeyDown JS events to keep track of the changes. When there is a key press or key down, set a flag value in a JavaScript variable.
2. In the uinload event, check if the flag is set.
3. If the flag is TRUE, then display the message to the user.
For more details, refer to this article.
Save & Exit in Web Application[
^]
Please note, when the user closes the WINDOW, you cannot handle this.
Let me know if this works.