How to link to external webpages (Windows Store apps using C#/VB/C++ and XAML)
Learn how to link to external webpages and display them in your Windows Store app using C# or Visual Basic.
Roadmap: How does this topic relate to others? See:
We assume that you can create a basic Windows Store app using C# or Visual Basic. For instructions on creating your first Windows Store app, see Create your first Windows Store app using C# or Visual Basic.
To add a link to an external webpage:
- Add a HyperlinkButton to your app by doing one of the following:
Your Windows Store app can display an external webpage in a WebView, but you can't navigate from your top-level page to an external webpage. For a complete example of using the WebView, see the Webview sample.
To display a webpage in your app
- Add a WebView to your app by doing one of the following:
- Add the next code to the code-behind file of the app. Where you place the code is up to you, depending on when you want to display the webpage. For example, you can add it to an OnNavigatedTo method to have the webpage load when the app loads. Or you can add it in a Click event handler to have the webpage load when a user clicks a button.