IE8 to SharePoint-‘Are you sure you want to navigate away from this page?’

by Chakkaradeep 11. July 2009 11:56

Building ‘easy’ and ‘complex’ user controls or field controls is one of those daily jobs that a SharePoint developer will do when building WCM websites.

Recently whenever I was navigating from the Edit Mode, whether it may be a postback or clicking on a link to a different page, IE8 prompts with this ‘wonderful’ yet ‘awesome’ message:

wcm_editmode_ie_error

Here is my custom field control in edit mode

wcm_editmode_control

So, as you can see in the above screenshot, I have a repeater and then some command arguments – Remove and Sort – Whenever I tried to remove the item or sort, IE8 halts for at least a minute and then prompts me with that message. Clicking on OK does finish the job, but why this message?. This does not happen in IE6, IE7 and Firefox.

Luckily, one of the MSDN forums user Sergioko has found a workaround for this problem:

Hi people,
I have installed Intenet Explorer 8 and started experience a problem. When my publishing page is in Edit mode and I click any link to navigate out to a different page IE8 prints 'Saving Page Content...' in its status bar for about 20 seconds and then displays a message box 'The page took too long to save...'. There were no such error with either IE7 or FireFox. After playing with Javascript debugging, I found that SBN_CallBackHandler() client function of SaveBeforeNavigationControl is not called as it supposed to. It looks like the implementation of XMLHttpRequest object in IE8 is somehow different from the previous release. I'm not sure if it is a bug of IE8 or SharePoint javascript but the problem exists. Fortunatelly, IE8 allows you to turn off its advanced setting 'Enable native XMLHTTP support' (enabled by default) in menu Tools/Internet Options/Advanced. It solves the problem but I would like to have more correct solution :-)  Any ideas?

Yes! Go to Tool->Internet Options->Advanced and disable ‘Enable native XMLHTTP support’ and everything works fine!

wcm_editmode_ie_option

I think the SharePoint Team should be made aware of this bug as this is indeed a show-stopper in regard to user experience in the Edit Mode (which is very common in WCM websites and upgrading to SP2 does not solve this issue)

 

Anyone from the SharePoint Team investigate this issue?

Comments

9/17/2009 9:37:04 AM #

trackback

Avoiding those

Avoiding those

Andrew Connell [MVP MOSS] | Reply

9/18/2009 1:06:02 AM #

trackback

SharePoint vs. Lotus; Project 2010 Wrapped in a Ribbon; No Windows 7 Upgrade from XP

Top News Stories SharePoint: What CIOs Should Know Before They Go (Channel Web) Microsoft's SharePoint

SharePoint Daily | Reply

9/19/2009 11:15:51 PM #

Boris Gomiunik

Thanks for the excellent tip!

Boris Gomiunik | Reply

10/3/2009 4:56:02 AM #

Vinay Bhatia

Another alternative is to remove the body.unLoad event handler
<script type="text/javascript">
_spBodyOnLoadFunctionNames.push("UnloadHandler");

function UnloadHandler()
{
document.body.onUnload = "";
}
</script>

Vinay Bhatia | Reply

10/6/2009 10:14:24 AM #

pingback

Pingback from jcgonzalezmartin.wordpress.com

WSS 3.0 & MOSS: Recopilatorio de enlaces interesantes (XXXIII)! « Pasión por la tecnología…

jcgonzalezmartin.wordpress.com | Reply

10/6/2009 10:14:47 AM #

trackback

WSS 3.0 & MOSS: Recopilatorio de enlaces interesantes (XXXIII)!

Aunque con un poco de retraso, aquí os dejo una nueva entrega del clásico recopilatorio

Blog del CIIN | Reply

10/15/2009 4:12:43 AM #

rob volk

Thanks!  This was the most frustrating thing ever.

rob volk | Reply

10/17/2009 1:29:23 AM #

trackback

SharePoint Kaffeetasse 129

Video SocialMedia Samurai With Laura Rogers Discussing Data Views Anpassung Search as you type for Links

Michael Greth [SharePoint MVP] | Reply

11/8/2009 1:18:36 AM #

Naveed Razaq

OHHHHHHHHHHHH Gr8, thanks. my problem solved. this is why i love blogs.

Naveed Razaq | www.apnimarzi.com | www.beyondweblogs.com

Naveed Razaq United States | Reply

11/26/2009 1:12:23 AM #

Nilang

Tx a lot!!! really helped me a lot!!!

Nilang United States | Reply

1/22/2010 4:01:11 AM #

K. Haesli

The Vinay Bhatia Solution does not work with latest Sharepoint 2007, because the unload handler is set in the body and his handler is replaced.
Here it is the solution that worked for me:

In the master page add in the head section:

<script type="text/javascript">
                                
                                function UnloadHandler()
                                {
                                                                           document.body.onUnload = "";
                                                                window.onbeforeunload = "";
                                }
</script>

Then just before the </body> tag add :
<script type="text/javascript">
                        UnloadHandler();
  
</script>

K. Haesli Switzerland | Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



About the author




NZ SharePoint Conference 2010

 

 

New Zealand SharePoint User Group