My webview display a html page which contains lots of links, if I click the link, the new page will open in the webview, is there a way to open the link in default browser rather than in webview?
Asked
Active
Viewed 876 times
1 Answers
0
You can handle the WebView.NavigationStarting
event as follows:
private void navigationStartingHandler(object sender, WebViewNavigationStartingEventArgs e)
{
e.Cancel = true;
Process.Start(e.Uri.ToString());
}
Here and here are more answers about opening web pages in default browser
-
Hi, my project is wpf, not windows8 app, there's no such an event in wpf webview – James Jan 21 '14 at 11:06
-
@James, could you provide link to the `WebView` class you're referring to? Because I can not find other `WebView` that is part of .NET Framework, which is not the one referred in my answer. Are you, perhaps, referring to [Awesomium WebView](http://docs.awesomium.net/html/T_Awesomium_Core_WebView.htm)? – Yurii Jan 21 '14 at 11:41