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
|