Re: Turning off "Are you sure you want to navigate away from this page?"
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > Re: Turning off "Are you sure you want to navigate away from this page?"




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-24-04 12:47 PM

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@T
K2MSFTNGP10.phx.gbl>...[vbcol=seagreen]
> Hi Matt,
>
> you could also inject the following javascript call manually in your actio
n:
>
>             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 reall
y
> wants to leave the page.
>
> Technically, the window.onbeforeunload and form.onsubmit events should cov
er
> 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, suc
h
> 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...
a/MCMS+2002+-+(complete)+FAQ.htm
> MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> MCMS Sample Code:
> http://www.gotdotnet.com/community/...nagement+Server
> 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/...nagement+Server 





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:05 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register