My problem was solved
assigning the lines like a function (JAVASCRIPT).
The problem was in an
ASPX page, and it was that with this method, the action ocurred when
i loaded/opened the website and no when i closed it, but adding a function, i haven't problems (like in this block and the links that you has given me):
function closeIt() {
alert('HI');
}
window.onbeforeunload = closeIt;
and no like this (like this i had the problem):
window.onbeforeunload = alert('Bye, bye');
Thanks very much for your help
Regards