O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Monitoring and Canceling Navigation

The WebBrowser control allows in-place navigation. Users may click on a link to change the page displayed in the control, and in addition, client-side JavaScript may assign the window.location.href property to navigate to a new location, which requires that the WebBrowser.IsScriptEnabled property be set to true.

Allowing the user free rein over navigation may not always be desirable, and you may want to monitor or even cancel the navigation of a web page programmatically. Fortunately, the Navigating event of the WebBrowser can be canceled. This is done by subscription to the event in code, or in XAML as shown:

<phone:WebBrowser Navigating="webBrowser_Navigating"/>

When the WebBrowser begins navigating to a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required