I am using a WPF 3.5SP1 WebBrowser control to display a page containing some javascript features. Then my program needs to call a javascript function that will make an asynchronous call. I need a way to get the result of this asynchronous call in C # so that I can process the result.
Is there a way that the javascript function can work until something happens (without blocking the browser)?
edit: I already use a callback - the second function is actually called "some-async-function-complete". It is called when the async event completes. Now I need a way to get the result in C #.
For further clarification: C #
var result = WebBrowser.InvokeScript("myscript")
Javascript
var result;
function myscript()
{
some-async-function();
return result;
}
function some-async-function-complete(retval)
{
result = retval;
}