Navigating to a Web Page Using the WebBrowserTask

The web browser task is used to launch the built-in Web Browser app and optionally navigates the browser to a specified URL:

Uri uri = new Uri("http://msdn.microsoft.com", UriKind.RelativeOrAbsolute);WebBrowserTask task = new WebBrowserTask { Uri = uri };task.Show();

If the Uri results in a 404 HTTP standard response code (Not Found), no exception is raised; instead the Windows Phone Search application is launched.

Sample Overview

Example code for the WebBrowserTask can be found in the LaunchWebBrowserViewModel in the downloadable sample code.

The LaunchWebBrowserView page contains a TextBox in which the user can enter a URL and a Launch Web Browser Button (see ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.