i am creating an MVC application.There was a neccessitity to make a variable in a session to null upon closing of the application (i.e. window/tab) but not upon refreshing t
document.onkeydown = disableF5; document.onkeypress = disableF5 document.onkeyup = disableF5; function disableF5(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); };