I wanna retrieve a value from the a page after this page loads using a javascript call from the server side in my API. I'm getting an error when I do this using a ThreadRunner to CreateWebView without UI, this is my code.
Quote:
ThreadRunner threadRunner = new ThreadRunner();
//Create a WebView through the ThreadRunner
WebView webView = threadRunner.CreateWebView();
threadRunner.Send(() =>
{
webView.LoadUrlAndWait("http://localhost/bel.public.api.imaging/previewgenerator/generator");
var base64 = (string)webView.EvalScript("designInstance.productData.modelData.renderer.domElement.toDataURL();", true);
});
I'm getting an error saying "designInstance.productData.modelData.renderer" is undefined but when I do the same using WinForms and the control, like this, works fine:
Quote:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
webView1.Url = @"http://localhost/bel.public.api.imaging/previewgenerator/generator";
webView1.Reload();
}
private void webView1_LoadCompleted(object sender, EO.WebBrowser.LoadCompletedEventArgs e)
{
var base64 = (string)webView1.EvalScript("designInstance.productData.modelData.renderer.domElement.toDataURL();");
}
}
How I can put it work on the APi???