title: Web browser navigation crash in wp8
body: <p>I am developing windows phone app .In this app i need to integrate with foursquare,So I loaded the url of foursqare in web browser.Web browser loaded the four square login page upto this it is working fine when i enter the login details and press enter,Then i will hide web browser and show the data in a list which came from service.After 10-15 seconds app gets crashes.This crash will not seen in emulator it happens only in phone(lumia 520).In lumia 920 it works fine</p>
  
  <p>my xaml code</p>
  
  <pre><code>                  &lt;Grid Grid.ColumnSpan="2" Name="browserGrid" Visibility="Visible"&gt;
                      &lt;phone:WebBrowser x:Name="foursquareBrowser" IsScriptEnabled="True" VerticalAlignment="Top" Height="720"   /&gt;
              &lt;!--&lt;ProgressBar x:Name="progressBar" IsIndeterminate="True" Visibility="Collapsed"/&gt;--&gt;
  
  
                  &lt;/Grid&gt;
  </code></pre>
  
  <p>browser.cs</p>
  
  <pre><code>         void foursquareBrowser_Loaded(object sender, RoutedEventArgs e)
      {
          try
          {
              foursquareBrowser.Navigate(new Uri("https://foursquare.com/oauth2/authorize?client_id=EYXOAIOMY3BNFR3DPB4SCK1JGR1J3FKDES4O5RGE3DDDM5WI&amp;response_type=code&amp;redirect_uri=http://www.visitabudhabi.ae"));
             foursquareBrowser.Navigating+=foursquareBrowser_Navigating;
          }
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message);
          }
      }
  
  
  
    private void foursquareBrowser_Navigating(object sender, NavigatingEventArgs e)
      {
          try
          {
              if (e.Uri.OriginalString.Contains("https://foursquare.com/login"))
              {
             foursquareBrowser.Navigate(new Uri("https://foursquare.com/oauth2/authorize?client_id=EYXOAIOMY3BNFR3DPB4SCK1JGR1J3FKDES4O5RGE3DDDM5WI&amp;response_type=code&amp;redirect_uri=http://www.visitabudhabi.ae"));
              }
              else if (e.Uri.OriginalString.Contains("code="))
              {
  
                       uri = e.Uri.OriginalString.ToString().Split(new string[] { "code=" }, StringSplitOptions.None).Last();
                      uri = uri.Remove(uri.Length - 4);
                        WebClient wc = new WebClient();
                      string postData = string.Empty;
                      wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
                      wc.UploadStringAsync(new Uri("https://foursquare.com/oauth2/access_token?client_id=EYXOAIOMY3BNFR3DPB4SCK1JGR1J3FKDES4O5RGE3DDDM5WI&amp;client_secret=1ROOV3FGYQZMVXV0TB1BRMHRIKB3RHI224M2NV0YFC0XXC1U&amp;grant_type=authorization_code&amp;redirect_uri=http://www.visitabudhabi.ae&amp;code=" + uri, UriKind.Absolute), "POST", postData.ToString());
                      wc.UploadStringCompleted += new UploadStringCompletedEventHandler(wc1_UploadStringCompleted);
                      foursquareBrowser.Navigating-=foursquareBrowser_Navigating;  
  
                  }
  
              }
  
  
  
          }
          catch (Exception ex)
          {
  
              MessageBox.Show(ex.Message);
          }
  
  
  
      }
  </code></pre>
  
  <p>It is crashing simply without any debugging information.</p>