Welcome Guest Search | Active Topics | Sign In | Register

Load Raw HTML Options
Media Tiga Warna
Posted: Saturday, May 8, 2021 1:28:20 PM
Rank: Newbie
Groups: Member

Joined: 5/8/2021
Posts: 1
Hi,

I'm new to EO WebBrowser and trying to understand on how to use the WebView and WebControl. I'm using version EO.WebBrowser 20.2.19.

I'm trying to load raw html to the web view using the following code:

private void button2_Click(object sender, EventArgs e)
{
string html =
@"
<html>
<head>
<title>Hello World</title>
</head>
<body>
Hello World
</body>
</html>
";

webView.LoadHtmlAndWait(html);
MessageBox.Show("Done");
}

However, I have not been able to make the web view displays the html.
Setting URL to the web view works: webView.Url = "www.google.com";
But, loading raw html directly not working.

Am I missing something?

Thanks,
Charles

eo_support
Posted: Saturday, May 8, 2021 3:07:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

Is the WebView already fully initialized? If you have just created the WebView, then it won't be initialized until many more message cycles, this means it won't completely until after your button2_Click returns (which is one message cycle that handles the click message). So if that's the case your LoadHtmlAndWait will never return because it can't complete until the WebView finishes initializing. You can try to use LoadHtml instead.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.