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
|
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!
|