Hi,
I'm using the Windows Phone 7 emulator in Visual Studio 2010 and I need to get the source code of a webpage. I open the emulator and put in the web address and hit OK. Nothing happens. I hit OK again after a few seconds and voila my text block is filled with the source. Why do I have to click the button twice for it to work (EVERY time)?
I use these methods:
WebClient client = new WebClient();
client.DownloadStringCompleted += ClientDownloadStringCompleted;
client.DownloadStringAsync(new Uri(address, UriKind.Absolute));
string sourc = add.GetName();
textBlock1.Text= sourc;
and
public void ClientDownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
string addy = e.Result;
add.SetName(addy);
//textBox2.Text = addy;
}