By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,732 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

IE: onbeforeunload event firing during asynchronous request

Frinavale
Expert Mod 5K+
P: 9,731
I don't have a clue how to work around this problem and I'm open to any suggestions on the topic....

In Internet Explorer it appears that the onbeforeunload event is fireing despite the fact that it is not a full page postback to the server that is occurring.

This is causing a problem because I'm displaying a <div> that blocks the page's content during the onbeforeunload event (in order to be consistent with what happens when I block the controls and display a "processing message" during partial page, asynchronous requests).

The problem is that the control that is supposed to block the page during the full page request to the server (during the onbeforeunload event) is also being displayed when the partial page request to the server is being made (via an ASP.NET UpdatePanel).

When the Ajax Request returns, the control that was supposed to block the page during a full page unload remains showing...

I don't really want both of the controls to show at the same time and would like to prevent the one that is supposed to be only be displayed during full page requests from being displayed during asynchronous requests.


-Frinny
Apr 1 '10 #1

✓ answered by Frinavale

Well I figured out a way around this.

During Ajax requests I hide the control that is meant for the full post back during the begin and the end request events.

It's working now but I still find it crazy that the onbeforeunload event is fired during asynchronous requests.

-Frinny

Share this Question
Share on Google+
1 Reply


Frinavale
Expert Mod 5K+
P: 9,731
Well I figured out a way around this.

During Ajax requests I hide the control that is meant for the full post back during the begin and the end request events.

It's working now but I still find it crazy that the onbeforeunload event is fired during asynchronous requests.

-Frinny
Apr 1 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.