The code below compiles but it does not display the text or photos of the website. I just want to run a program that involves HTTP communication with Silverlight. Any idea why I am not getting the website to display? I just get "error occurred" in the textBlock to display instead
namespace SilverlightApplication4{publicpartialclassMainPage:UserControl{string baseUri ="http://yahoo.com";WebClient client =newWebClient();publicMainPage(){InitializeComponent();
client.DownloadStringCompleted+=newDownloadStringCompletedEventHandler(client_DownloadStringCompleted);}privatevoidButton1_Click(object sender,RoutedEventArgs e){
client.DownloadStringAsync(newUri(baseUri));}void client_DownloadStringCompleted(object sender,DownloadStringCompletedEventArgs e){if(e.Error==null)
textBox.Text="Using WebClient: "+ e.Result;else{
textBox.Text= e.Error.Message;
textBlock.Text="error occurred";}}}}