.Net WebBrowser.DocumentText Isn’t Changing!

Try the following:

browser.Navigate("about:blank");
HtmlDocument doc = browser.Document;
doc.Write(String.Empty);
browser.DocumentText = _emailHTML;

I’ve found that the WebBrowser control usually needs to be initialized to about:blank anyway. The same needs to be done between navigates to different types of content (like text/xml to text/html) because the renderer is different (mshtml for text/html, something else for text/xml).

See Also: C# 2.0 WebBrowser control – bug in DocumentText?

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)