2008-10-24 50 views

回答

9
System.Windows.Browser.HtmlPage.Window.Navigate(
    new Uri("http://www.google.com"), 
    "_blank" 
    ); 

如果您只想在當前瀏覽器窗口中導航,則可以省略目標(「_blank」)。

2

從另一個頁面導航到另一個頁面。

Frame frame =this.parent as Frame; 
frame.navigate(new Uri("/Views/Details.xaml"),Uri.Relative); 

請注意,您必須在MainPage.xaml中有一個框架。 所以其他頁面都只是調用框架父

1

假設你正在編輯的代碼隱藏頁類的文件

this.NavigationService.Navigate(new Uri("/OtherPage.xaml", UriKind.Relative)); 
+0

我認爲OP意味着一個網頁,而不是XAML頁面。 – JavaAndCSharp 2011-12-11 20:30:06

0

你們都還可以試試這個

this.content=new (place the page name which You want to navigate); 

      but this code only works while navigate page having in same folder else You have to write like in given below manner 

this.Content = new Views。(放置您想要導航的頁面名稱);

  here in place of Views write the folder name where the page having... 

希望它也對你所有的幫助。

相關問題