title: get html content of a page with Silverlight
body: <p>I'm trying to get the html content of a page using silverlight. Webresponse and request classes don't work in silverlight.</p>
  
  <p>I did some googling and I found something. This is what i tried:</p>
  
  <pre><code>public partial class MainPage : UserControl
   {
    string result;
    WebClient client;
  
    public MainPage()
    {
     InitializeComponent();
     this.result = string.Empty;
     this.client = new WebClient();
     this.client.DownloadStringCompleted += ClientDownloadStringCompleted;
    }
  
    private void btn1_Click(object sender, RoutedEventArgs e)
    {
     string url = "http://www.nu.nl/feeds/rss/algemeen.rss";
  
     this.client.DownloadStringAsync(new Uri(url, UriKind.Absolute));
  
     if (this.result != string.Empty &amp;&amp; this.result != null)
     {
      this.txbSummery.Text = this.result;
     }
    }
  
    private void ClientDownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
    {
     this.result = e.Result;
     //handle the response.
    }
   }
  </code></pre>
  
  <p>It gives me a runtime error after pressing the button:</p>
  
  <p>Microsoft JScript runtime error: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid.  Check InnerException for exception details.   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
     at System.Net.DownloadStringCompletedEventArgs.get_Result()
     at JWTG.MainPage.ClientDownloadStringCompleted(Object sender, DownloadStringCompletedEventArgs e)
     at System.Net.WebClient.OnDownloadStringCompleted(DownloadStringCompletedEventArgs e)
     at System.Net.WebClient.DownloadStringOperationCompleted(Object arg)</p>
  
  <p>I've tried numerous things but all failed. </p>
  
  <p>What am i missing? Or does anyone know how i could achieve this in a different way?</p>
  
  <p>Thanks in advance!</p>