Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

Cannot avoid back or forward navigation in 19.2.91 Options
Riephi
Posted: Tuesday, January 7, 2020 9:19:49 AM
Rank: Advanced Member
Groups: Member

Joined: 7/17/2015
Posts: 36
Dear Support Team,

I'm having trouble avoiding back or forward navigation in your latest version. In older versions I avoided back or forward navigation in your browser by using the following code:

Code:
private void BeforeNavigateHandler (object sender, BeforeNavigateEventArgs e)
{
    if (e.NavigationType == NavigationType.BackOrForward)
    {
        e.Cancel = true;
        return;
    }
}


But BeforeNavigateEventArgs.NavigationType does not exist anymore.

How can I avoid back or forward navigation in your latest version? Neither comparing e.NewUrl with e.OldUrl nor e.IsRedirect works in my case.

Thank you in advance for some information!

Best Regards!
eo_support
Posted: Friday, January 10, 2020 1:44:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 22,273
Hi,

Sorry about the delay. We were trying to confirm the details before responding. We have confirmed that NavigationType will be brought back in our up coming 2020 release. Currently we are doing some final testing on this release and it is expected to be out in less than 2 weeks.

Thanks!
eo_support
Posted: Friday, January 17, 2020 3:03:03 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 22,273
Hi,

We have posted our 2020 build that added this property. Note that in order to disable back/forward, you will need to handle both BeforeNavigate and LoadFailed event.

When you set e.Cancel to true in BeforeNavigate it will eventually cause the request to be cancelled. This will cause LoadFailed event. If you do not handle this event, it will result in the default "this request has been cancelled" error message to be displayed. You can use the following code to avoid this:

Code: C#
private void WebView_LoadFailed(object sender, LoadFailedEventArgs e)
{
    if (e.Task.ErrorCode == ErrorCode.Canceled)
        e.ShouldShowError = false;
}

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!
Riephi
Posted: Monday, January 27, 2020 7:01:19 AM
Rank: Advanced Member
Groups: Member

Joined: 7/17/2015
Posts: 36
Hi,

thanks for your reply! With the new version it's working again.

Best regards
eo_support
Posted: Monday, January 27, 2020 3:51:05 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 22,273
Great. Thanks for confirming the fix!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.