Windows Phone 7 Open Browser from Button

I love Stack Overflow… They saved me from a Windows Phone 7 problem.http://stackoverflow.com/questions/4253186/webbrowsertask-fails

Basically, I was trying to use a WebBrowserTask to open a URL in a browser from my phone app. It kept opening a browser, but without the address bar populated.

Turns out, when you are debugging your application, it fails. Running outside of debug mode, the browser opens to the proper link just fine.

WebBrowserTask task = new WebBrowserTask();
task.URL = Uri.EscapeDataString(sURL);
task.Show();

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s