window.onbeforeunload get called on other buttons in page

  • Thread starter Thread starter sonali
  • Start date Start date
S

sonali

i want to dopstback should get called on brower's close button click
also


function closewindow()
{
if (window.dialogArguments) {
// Calling the method (given as argument) to cause the postback
window.dialogArguments.doPostBack();
}
else
{
opener.doPostBack();
}
window.close();

}

window.onbeforeunload =closewindow ;



but this window.onbeforeunload event fiers on every button click of the
page
 
Yes, this is how the event works.

If you don't want it to get called during a postback, you will have to set
some variable that your function checks, and does nothing in the case the
variable was set.
 
Marina said:
Yes, this is how the event works.

If you don't want it to get called during a postback, you will have to set
some variable that your function checks, and does nothing in the case the
variable was set.




Where should i exactly set it?
 
Marina said:
Yes, this is how the event works.

If you don't want it to get called during a postback, you will have to set
some variable that your function checks, and does nothing in the case the
variable was set.



and where to cleare it?
 
Back
Top