title: want to set alert when page url changes
body: <p>How do I call an event while user trying to leave the page either by navigating to another page or by changing url?
  I have tried following methods but its not working.</p>
  
  <pre><code> protected void Page_Unload(object sender, EventArgs e){}
  
   protected override void OnUnload(EventArgs e){}
  </code></pre>
  
  <p>Thanks,</p>