Problem with Windows Phone 7 WebBrowserTask

I am trying to open this URL using WebBrowserTask in WP7 and it does not work (I get a custom error on our site), but when I type it manually, it works fine. Any ideas?

It also works great on Google Chrome and IE7.

This is the URL:

http://www.symfonee.com/Improv/addison/comedians/Bio.aspx?ShowDate=12/15/10&ShowTime=8:00p&Uid=54918a0d-1beb-4552-bdc8-2d474e3ea5ae

And this is my code:

string url = "http://www.symfonee.com/Improv/addison/comedians/Bio.aspx?ShowDate=12/15/10&ShowTime=8:00p&Uid=54918a0d-1beb-4552-bdc8-2d474e3ea5ae";

WebBrowserTask browser = new WebBrowserTask();
browser.URL = url;
browser.Show();

Thank!

EDIT:

Without any of the solutions below, this code works just fine:

WebBrowserTask browser = new WebBrowserTask();
browser.URL = "http://www.youtube.com/results?search_query=Windows+Phone+7&aq=f";
browser.Show();

I do not understand what is different?

+5
source share
4 answers

There is an error in the SDK. In the url containing &, you need to avoid it.

For instance:

... Uri.EscapeDataString("&") + "ShowTime=8:00p"

+5
source

, , , URL. - , , URL- . API, .

Uri.EscapeDataString . .

string url = "http://www.symfonee.com/Improv/addison/comedians/Bio.aspx" +
    "?ShowDate=" + Uri.EscapeDataString("12/15/10") +
    "&ShowTime=" + Uri.EscapeDataString("8:00p") +
    "&Uid=" + Uri.EscapeDataString("54918a0d-1beb-4552-bdc8-2d474e3ea5ae");
+3

:

s = "www.. "; //url
s = Uri.EscapeUriString(s);
task.URL = HttpUtility.UrlEncode(s);
+1

URI. , :

string url = "http://www.symfonee.com/Improv/addison/comedians/Bio.aspx?ShowDate=12/15/10&ShowTime=8:00p&Uid=54918a0d-1beb-4552-bdc8-2d474e3ea5ae";

WebBrowserTask browser = new WebBrowserTask();
browser.URL = Uri.EscapeUriString(url);
browser.Show();
0

All Articles