开发者

"System.Windows.Forms.HtmlDocument" message appears when navigate webbrowser

开发者 https://www.devze.com 2023-02-08 16:48 出处:网络
when I try to set a specific html data stored in string into webbrowser, this message appears instead of html content

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消