Microsoft Content Management Server - Re: Turning off "Are you sure you want to navigate away from this page?"

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > September 2004 > Re: Turning off "Are you sure you want to navigate away from this page?"





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Turning off "Are you sure you want to navigate away from this page?"
Matt

2004-09-24, 7:47 am

Hi Stefan,

Yup. This is exactly what I tried to start with, but it doesn't work
for me if you inject WBC_offWarningBeforeLeave() into the HREF
attribute of the A tag before __doPostBack(...).

In a minor flash of inspiration, I just added an ONMOUSEUP attribute
to the A tag, with a value of WBC_offWarningBeforeLeave(). Works like
a charm!

Have a great w/e..

Matt


"Stefan [MSFT]" <stefang@online.microsoft.com> wrote in message news:<ur#Qp$UoEHA.2920@TK2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> Hi Matt,
>
> you could also inject the following javascript call manually in your action:
>
> WBC_offWarningBeforeLeave();
>
> This will do it for a single call (please use View Source on your posting
> while in edit mode to see how MCMS injects this call itself).
>
> Please check also the documentation:
> http://msdn.microsoft.com/library/d...arningtopic.asp
>
> In the authoring modes (WebAuthorContextMode.AuthoringNew,
> WebAuthorContextMode.AuthorReedit), when the user clicks on any link that
> navigates away from the authoring page, this may result in loss of any
> unsaved content. Because of the potential loss of authoring content,
> WebAuthor has built in a warning dialog that prompts the user if she really
> wants to leave the page.
>
> Technically, the window.onbeforeunload and form.onsubmit events should cover
> all such occurences. In all other cases, the warning dialog would come up.
> However, there are two cases that the dialog can come up erroneously when it
> should not:
>
> a.. When an <a> tag with the href attribute hooked up to JavaScript, such
> as <a href="java script:alert('hello')">, is clicked on.
> b.. When form.submit() is called explicitly in JavaScript.
> Because of these problems, the Console.EnableLeaveAuthoringWarning flag is
> designed to allow developers to turn off the warning dialog altogether if
> desired.
>
>
> Cheers,
> Stefan.
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> MCMS FAQ:
> http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
> http://www.gotdotnet.com/community/...t+S
erver

> MCMS Whitepapers and other docs:
> http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
> --------------------------------
>
>
> "Matt" <mattoc@tiscali.co.uk> wrote in message
> news:cff562cb.0409230116.5bfe7e0b@posting.google.com...
> news:<uYViT0LoEHA.3488@TK2MSFTNGP12.phx.gbl>...
> http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm#214E0DBE-E203-4E20-9D8A-A003B4D4B4D5
> rights.
> http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
> http://www.gotdotnet.com/community/...t+S
erver

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com