I have this script in my aspx page
<script language="JavaScript" type="text/javascript">     
    window.onbeforeunload = function(e) {
        return 'Bye now!';
    }; 
</script>
But this is not invoked when I close the browser. I need to pop an alert asking the user to confirm. I need to do this in the aspx page using javascript. The browser I tried was mozilla firefox. Thanks