I use c# asp.net 4 web.forms.
I have a page (lets called it X) I need execute a method on X in this situation only:
- When User visit another URL, directly input in the Browser or clicking another link on the Page.
- When User Log Out from my Web Application.
- When a User Close the Browser.
At the moment I'm trying Page_Unload Event
but as for MSDN "Occurs when the server control is unloaded from memory" and I'm not able to make it works as expected.
Looking in the documentation I cannot find a suitable Event for my Page.
What are the possible alternative solutions? Thanks for your time on this.