View Single Post
  #1 (permalink)  
Old May 3rd, 2010, 07:54 AM
ran_stb ran_stb is offline
Registered User
 
Join Date: Apr 2010
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Navigation to a Page

Hi,

Im trying to create a HyperlinkButton that will cause the browser to navigate to another page.

I'm doing the following:

private void hyperlink_Click(object sender, RoutedEventArgs e) {
testpage1 page = new testpage1();

Uri _uri = new Uri("http://www.silverlight.net", UriKind.Absolute);

NavigationService ns = this.NavigationService;

this.NavigationService.Navigate(_uri);
}

The thing is that the this.NavigationService is always null and since that I get exceptions.

Is that the right way to perform a navigation between pages ?
What do I do wrong ?

Thanks,
Ryan
Reply With Quote