How to detect in a javascript function that the page is about to postback

  • Thread starter Thread starter tarun.kataria
  • Start date Start date
T

tarun.kataria

Hi all,

In my ASP.NET application, I am trying to detect in a javascript
function, which is triggered by the event onbeforeunload, that if the
window is getting closed beacuse its a post back or if the user has
clicked the X button of the browser. Is there a way in javascript to
know that a postback is about to happen i.e. the user has clicked a
button (asp.net control).

thanks
 
there is no supported method. the most common trick is to check the mouse
coordinates, they will be negative for the close button.

-- bruce (sqlwork.com)
 
Back
Top