How can one notifiy a user that there are uncommitted changes on the ASP.NET DetailsView
-
20-09-2019 - |
Question
I used the ASP.NET DetailsView across my application. I would like to know how I can detect that there are unsaved changes on the DetailsView and notify the user before navigating away from the page.
Solution
There is no "fullproof" way of detecting when a user is leaving the page. You would need some form of Ajax/Javascript solution to detect when the page is unloading, then you can just retrieve the details currently in the DetailsView, against the same record stored in the database.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow