title: Executing c# commands when navigating away from a certain page
body: <p>I've checked around the entire web and could not find an answer for this.</p>
  
  <p>For my project, i made a form to delete an account in a website, but i want it to relocate you to another page saying "the account x had been deleted successfully."
  Thus, i need to keep the Sessions still set for the user name, to be able to write the name of the user instead of that "x", and then when they navigate away, that Session variable will be reset to nothing.
  But how?
  Of course, i can set on every button possible to delete it, but that's just stupid.
  Is there a way to run c# commands when you navigate away from a certain page?</p>
  
  <p>Edit: All this time i've been looking strictly c#, but i now found out there's this thing called unload in javascript.
  Question is: how can i reset the session variable using that?</p>