DownloadStringAync problem
<p>When I click the submit button (once), it doesn't display the HTML of the given website. When I click submit button (twice) then it displays the html. I think it might be because the DownloadStringAsync hasn't completed downloading the website.</p>

<p>I know I could put the TextBox.text into the downloadstringcompleted, but I don't want it to because it will be used for a class later on and the result will have a get/set method.</p>

<p>How do I fix this? Here is my code:</p>

<pre><code>    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Microsoft.Phone.Controls;

    namespace WebTest
    {
        public partial class MainPage : PhoneApplicationPage
        {
            private string result;
            // Constructor
            public MainPage()
            {
                this.completed = false;
                InitializeComponent();
            }

            private void search_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
            {
                if (e.Error == null)
                {
                    this.result = e.Result;
                }
            }

            private void button1_Click(object sender, RoutedEventArgs e)
            {
                displayHTML(textBox1.Text);
                textBlock1.Text = this.result;
            }

            private void displayHTML(string URL)
            {
                WebClient search = new WebClient();
                search.DownloadStringCompleted += new DownloadStringCompletedEventHandler(search_DownloadStringCompleted);
                search.DownloadStringAsync(new Uri(URL));
            }
        }
    }
</code></pre>
