Windows Phone Mango: becareful with IE 9 and your code !

AS you probably know, Windows PHone Mango has IE 9 as browser. IE 9 is pretty cool, but in your code,you could be surprised... My code has different behavior using Windows Phone Nodo (IE7) and Mango (IE9) with exactly the same code and with the same version of the SDK !!!

I discovered this behavior after coding an authentication part in my next application, using the Windows Azure ACS and a sample code provided by Microsoft.

The problem is with the WebBrowser control, look at this sample :

 

BrowserControl.Navigated += new EventHandler<NavigationEventArgs>(BrowserControl_Navigated);
BrowserControl.NavigateToString("<html><head><title></title></head><body></body></html>");
private void BrowserControl_Navigated(object sender, NavigationEventArgs e)         {              ...

In Nodo (IE7) the e.Uri is null, but in Mango (IE9), e.Uri is not null but empty !!!

So in Mango, you have to check the url like this:

string.IsNullOrEmpty(e.Uri.ToString())

So, be carreful in your code !!!

 

Hi there !

 

Specialized in .net technologies for many years, I am a technology fan in both asp.net and wpf/silverlight, using c# and .net 4.5

Taking advantages of new opportunities offered by the Windows Azure platform and WP/Win 8, I develop applications for Windows Phone, 5 of them are already available on the market place.


 

 

Month List