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

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
 
B

Bruce Barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top