I have a Webbrowser control that I am using to generate thumbnails of web pages. Below is my code:
webBrowser.AllowNavigation = true;
webBrowser.Navigate(@"about:blank");
webBrowser.DocumentText = url;
if (webBrowser.Document != null)
webBrowser.Document.Write(url);
Where url is a string containing the html.
Using the above code results in webBrowser.DocumentText
sometimes being populated with my html and othertimes not.
However I have found that line 3 and 5 are basically doing the same thing and webBrowser.Document.Write(url);
is a much better way of writing the html to the browser, so I removed line 3 and it works everytime.
So my question is why by having line 3 does it cause it to fail occasionally, since line 5 is in effect making line 3 redundant anyway?