<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>
Call the logout.aspx when window closes using javascript + jquery. Do whatever you want to do in the logout.aspx page load event.
The above snippet will have to be added in your master page's html.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…