Welcome Guest Search | Active Topics | Sign In | Register

LoadFailed event Options
PhilipT
Posted: Saturday, February 15, 2014 5:39:06 AM
Rank: Advanced Member
Groups: Member

Joined: 2/15/2014
Posts: 52
Hi,

I just discovered this excellent webBrowser control that can potentially replaced the .NET WebBrowser control so am evaluating this now.

I have a local html page, a very simple just to test this EO.WebBrowser control. I subscribed to LoadFailed event to check if there will be errors when loading a page using MessageBox.Show, see below:

void m_WebView_LoadFailed(object sender, EO.WebBrowser.LoadFailedEventArgs e)
{
MessageBox.Show("LoadFailed -> " + e.ErrorMessage + " " + e.FailedUrl);
}

My simple webpage is located at C:\HTML\WebExit.html, when I ran the app, the event fired twice, the first showed "The request was cancelled", after that, there's another message box with the same error + "C:\HTML\WebExit.html".

But the page was successfully displayed which is weird. If the page was successfully loaded, I should not receive the LoadFailed events.

Any idea?

Thanks
Philip
eo_support
Posted: Saturday, February 15, 2014 9:30:58 PM
Rank: Administration
Groups: Administration

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

We have just posted a new build. Please download the new build from our download page and see if you see the same problem.

When EO.WebBrowser starts, it automatically loads an empty page into the browser. However if you immediately loads another page, the loading request for the empty page may have not yet finished when you submit the loading request for the new Url. In this case the old request will be canceled. This is why you received LoadFailed event. Receiving load failed event does not necessarily mean the current request failed --- it can be that the previous request has been canceled.

However because the new purpose of the initial empty page is only to initialize the WebBrowser rather than a real "navigation", it makes sense to handle this request transparently to the user. As such the new build bypassed LoadFailed event for this internal request.

Hope this makes sense to you.

Thanks!
PhilipT
Posted: Sunday, February 16, 2014 12:39:34 AM
Rank: Advanced Member
Groups: Member

Joined: 2/15/2014
Posts: 52
Hi,

Just downloaded the latest build and run. It works perfectly now. The application does not receive the LoadFailed event on the initial empty page and the LoadFailed event is fired if it attempts to load a page that cannot be found.

I noticed something has change in the implementation of JSExtInvoke. In previous build, the javascript can simply call like this
var getFirstName = function()
{
var obj = EO.extInvoke("getFirstName");
alert obj;
}

and i can get the value that C# returned. Noticed i didn't pass any parameter.

With the new build, looks like i have to pass at least pass one parameter.

var obj = EO.extInvoke("getFirstName", [ null ]);

Is this now the case with the latest build?

Thanks
Philip
eo_support
Posted: Sunday, February 16, 2014 2:28:15 PM
Rank: Administration
Groups: Administration

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

Thanks for the update. We have confirmed that this is the behavior in the new build. It should not be required to pass a null array if you do not have any arguments to pass, so we will change this and in the next build extInvoke should work without arguments as it did before.

Thanks!
eo_support
Posted: Saturday, February 22, 2014 10:40:57 PM
Rank: Administration
Groups: Administration

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

This is just to let you know that we have posted a new build that fixed the empty argument array issue. You can download the new build from our download page. This build you can use EO.extInvoke("getFirstName") without having to pass an empty array.

Thanks!
PhilipT
Posted: Saturday, February 22, 2014 10:42:45 PM
Rank: Advanced Member
Groups: Member

Joined: 2/15/2014
Posts: 52
Great! Thanks for the info.

I will be posting a few queries soon...


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.