Click here to Skip to main content
15,908,111 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello All,

My Question is if there is anyway that we can navigate from a XAML page to a www website?

For Example, I have a button which on click should Open New Page and load Google Home Page ("www.google.com")

My Code is
HTML
<HyperlinkButton Content="Click Here to Open Google" Name="GGL" Click="GGL_Click" Foreground="Gray" IsTabStop="False" Tag="www.google.com" />


and my code behind is
VB
Dim GGLButton As HyperlinkButton = DirectCast(sender, HyperlinkButton)
Dim viewsource As String = GGLButton.Tag.ToString
HelpingHand.Navigate(New Uri(viewsource, UriKind.Relative))


The Error that I get is

Navigation is only supported to relative URIs that are fragments, or begin with '/', or which contain ';component/'. Parameter name: uri

This works when I try to navigate to a page inside my project. Please assist me in this.
Posted

1 solution

Try using 'UriKind.Absolute' rather than 'UriKind.Relative'
 
Share this answer
 
Comments
Vamshi Krishna Naidu 22-Jan-12 13:27pm    
I Tried. But still no Luck.
Lakamraju Raghuram 22-Jan-12 13:45pm    
I think you should be using urimapper. Check for info here:
1. http://stackoverflow.com/questions/3020326/sl-3-navigation-not-working
2. http://msdn.microsoft.com/en-us/library/cc838245(v=vs.95).aspx
Vamshi Krishna Naidu 22-Jan-12 14:09pm    
Working Now.
Lakamraju Raghuram 22-Jan-12 21:52pm    
(-:
Sergey Alexandrovich Kryukov 22-Jan-12 18:22pm    
Right, a 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900