p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   Silverlight 3 (http://p2p.wrox.com/silverlight-3-581/)
-   -   Navigation to a Page (http://p2p.wrox.com/silverlight-3/79283-navigation-page.html)

ran_stb May 3rd, 2010 07:54 AM

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


All times are GMT -4. The time now is 09:55 PM.

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.