"System.Windows.Forms.HtmlDocument" message appears when navigate webbrowser
when I try to set a specific html data stored in string into webbrowser, this message appears instead of html content
System.Windows.Forms.HtmlDocument
my code is : note that html code stored in temp_data
this.main_webpage.Navigate("about:blank");
HtmlDocument d_c = main_webpage.Document;
d_c.Write(temp_data);
main_webpage.DocumentText = d_开发者_如何学Cc.ToString();
main_webpage.Refresh();
The ToString
is the one inherited from Object
, which returns the type of the object. HtmlDocument
doesn't override it.
Use the Body
property of HtmlDocument
- it returns the body element:
main_webpage.DocumentText = d_c.Body.InnerHtml;
精彩评论