积极答复者
NavigationService.Navigate(new Uri("http://www.bing.com", UriKind.Absolute))为什么会出错?

问题
-
这样写为什么会出错啊?
private void hyperlinkButton1_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("http://www.bing.com", UriKind.Absolute));
}错误跳到这边:
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
// 巡覽失敗; 切換到偵錯工具
System.Diagnostics.Debugger.Break();
}
}
答案
-
你好,
正如MainTao所说,打开网页可以使用webbrowser控件。如:
webBrowser1.Source = new Uri("http://www.bing.com", UriKind.Absolute);
或者
webBrowser1.Navigate(new Uri("http://www.bing.com", UriKind.Absolute));
具体可以参考MSDN:
How to: Display Web Content from the Network Using the WebBrowser Control for Windows Phone
Keep Fighting
-
你好,
你说的方法也是可以的,
private void hyperlinkButton1_Click(object sender, RoutedEventArgs e)
{
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://cn.bing.com", UriKind.Absolute);//url
webBrowserTask.Show();
}Keep Fighting
- 已标记为答案 Shi Ding 2012年4月26日 15:11
全部回复
-
你好,
正如MainTao所说,打开网页可以使用webbrowser控件。如:
webBrowser1.Source = new Uri("http://www.bing.com", UriKind.Absolute);
或者
webBrowser1.Navigate(new Uri("http://www.bing.com", UriKind.Absolute));
具体可以参考MSDN:
How to: Display Web Content from the Network Using the WebBrowser Control for Windows Phone
Keep Fighting
-
你好,
你说的方法也是可以的,
private void hyperlinkButton1_Click(object sender, RoutedEventArgs e)
{
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://cn.bing.com", UriKind.Absolute);//url
webBrowserTask.Show();
}Keep Fighting
- 已标记为答案 Shi Ding 2012年4月26日 15:11