Reputation:
I'm developing a website in VB.NET/ASP.NET 2.0.
I want to invoke an event (Server Side) once a user leaves my site by putting a different URL in the address bar, is it possible? If so, how?
Upvotes: 0
Views: 156
Reputation: 107940
Invoke the onbeforeunload
event, like such :
window.onbeforeunload = function () {
//Your logic
};
Upvotes: 1
Reputation: 57877
You can use the onbeforeunload
JavaScript event to trigger when a user is about to navigate away from your site.
Upvotes: 0