title: Web Browser Navigation WP8
body: <p>I have a problem when i try to send the URL to the browser as a tag of a Button. Look what I'm doing:</p>
  
  <pre><code>&lt;Button Content="101" Tag="http://stackoverflow.com/questions/ask" Width="446" Click="Button_Click" /&gt;
  </code></pre>
  
  <p>Navigate to browser page:</p>
  
  <pre><code>private void Button_Click(object sender, RoutedEventArgs e)
          {
              NavigationService.Navigate(
                  new Uri("/webbrowser.xaml?path=" +
                          HttpUtility.UrlEncode((sender as Button).Tag.ToString()),
                          UriKind.Absolute));
          }
  </code></pre>
  
  <p>On webbrowser.xaml I have:</p>
  
  <pre><code> &lt;phone:WebBrowser x:Name="MiniBrowser" HorizontalAlignment="Left" 
  IsGeolocationEnabled="True"  IsScriptEnabled="True" Width="456" Margin="0,0,0,10"/&gt;
  </code></pre>
  
  <p>and on webbrowser.xaml.cs :</p>
  
  <pre><code> protected override void OnNavigatedTo(NavigationEventArgs e)
          {
              string path = "";
  
              if (NavigationContext.QueryString.TryGetValue("path", out path))
              {
                  if (!string.IsNullOrWhiteSpace(path))
                  {
                      MiniBrowser.Navigate(new Uri(path, UriKind.Absolute));
  
                  }
              }
          }
  </code></pre>
  
  <p>Can someone explain me what I'm doing wrong? Becose when I press the button i have Debuger.Break(); :-(</p>