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

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

trackback

Avoiding those

Avoiding those

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

Boris Gomiunik

Thanks for the excellent tip!

Oct 03 Vinay Bhatia

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>

pingback

Pingback from jcgonzalezmartin.wordpress.com

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

Oct 06 Blog del CIIN

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

Oct 15 rob volk

rob volk

Thanks!  This was the most frustrating thing ever.

trackback

SharePoint Kaffeetasse 129

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

Nov 08 Naveed Razaq

Naveed Razaq

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

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

Nov 26 Nilang

Nilang

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

Jan 22 K. Haesli

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>

Best deck stain

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

Aug 01 Daredorm

Daredorm

Agreed with the poster above me. Let's hope Sharepoint get this problem solved soon.

Aug 11 Robin

Robin

Worked like a charm. Thank you very much.

Btw is there already a fix for SP?

Gr,
Robin

Aug 11 chakkaradeep

chakkaradeep

@Robin - unfortunately, there is no fix Frown

Aug 12 Plasma tv

Plasma tv

Thanks for sharing this useful information. IE 8 is a standard mode, its more compatible one for intranets. Normally, Sharepoint SP2 adds more support to IE 8.

wedding photographer neath

im having major issues with IE8, this has been ongoing for a while now and cant seem to find the exact into i need with regard to javascript debugging, some of the info above has helped me mind, thanks.

wedding photographer neath

yep this worked for me also

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading





Creative Commons License
Chaks' Corner Blog by Chakkaradeep Chandran is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Based on a work at www.chakkaradeep.com.
Permissions beyond the scope of this license may be available at http://www.chakkaradeep.com.