Windows Phone 8.1 and Windows Runtime Apps How to #16 – Displaying External Web Page with in a Windows Phone 8.1 App

In Windows Phone 8 and earlier version , the developers could use the WebBrowser control or the WebBrowserTask to display external webpages within the app .

If you want to display an external webpage within your Windows Phone 8.1 Windows runtime app , you can use the WebView which provides the page a control which can host some HTML content.

How to display external web page with in a Windows Phone 8.1 App ?

1. Simply add the WebView control to the page from the toolbox or by adding the below tag . Provide a name to the WebView control . In this example , the control name is provided as “MobileOSGeekView”.

<Grid>
  <WebView x:Name="MobileOSGeekView">           
  </WebView>
</Grid>

2. Use the Navigate method of the WebView object by providing the necessary Uri which you need to display in a WebView.

private void LaunchMobileOSGeekWebsite()
{
           
   Uri NavigateUrl = new Uri(@"http://www.developerpublish.com");
   // Navigate to the MobileOSGeek website within the webview
   MobileOSGeekView.Navigate(NavigateUrl);

}

3. When you call the above method , you will see the external webpage being loaded in to the WebView control of the page.

image

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...