We\'re tryin to implement some kind of feedback, which I saw in MSDN web-site. More concrete when user first enters to our site, I want to show a pop-up which will ask user to l
The problem is, it's not really possible to know definitively when someone is "leaving" your web site.
You could try to capture via Javascript when they are navigating away from pages on your site, but even if you do that, and you know they are going to a page on some other site, you could easily get 'false positives" there if, for example, someone has your site open in multiple tabs.
I think that is the reason you usually find such "feedback popups" either come when you first visit a site, or come during some process in the application itself - such as at the end of a shopping cart purchase.
Without hindsight, there really is no way to know what the last page someone is visiting on your site will be.
And in the comments, others have noted that this type of behavior would likely annoy your users... even if they opted-in to it somehow upon visiting the site.