Detect Browser Close on Asp.net

Asked
Active3 hr before
Viewed126 times

2 Answers

closebrowser
90%

Meta Stack Overflow ,Stack Overflow en español, Stack Overflow help chat ,Stack Overflow на русском

<script type="text/javascript">
var closing = true;
$(function () {
    $("a,input[type=submit]").click(function () { closing = false; });
    $(window).unload(function () {
        if (closing) {
            jQuery.ajax({ url: "http://localhost:49591/Account/LogOff", async: false });
        }
    });
});
</script>
88%

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL), featuresstuff Competitions Conferences News The Insider Newsletter The Daily Build Newsletter Newsletter archive Surveys Product Showcase CodeProject Stuff

Other "close-browser" queries related to "Detect Browser Close on Asp.net"