We help IT Professionals succeed at work.

Website works in Chrome but not WebBrowser component

rpm
rpm asked
on
100 Views
Last Modified: 2019-01-27
Hi,

I am trying to use a particular website, using a WebBrowser component in a VB.Net app.

I do not have any control over the website that I am trying to access, but it works fine through Google Chrome.

Looking at the source of the website in question, it has the following form defined:

<form name="frmSearch" id="frmSearch" method="post" onSubmit="return false;" action="MeetingList.php">

Within this form, is the following button:

<a id="SPFundGoButtonLink" href="javascript:DoSearch(gnSearchFund);"><img id="SPFundGoButtonImage" src="4057/images/go.gif" border="0"></a>

If I visit this site in Google Chrome and click the above defined button, it works fine, however if I navigate to the same site in a WebBrowser component and click the same button it generates the following error:

'gnSearchFund' is undefined.

Any idea why this works in Chrome but not the WebBroswer component, and more importantly, can anyone think of a workaround for this?
Comment
Watch Question

DevAdminSystem Engineer | .NET Developer | Microsoft MVP | Technical Speaker
CERTIFIED EXPERT

Commented:
The WebBrowser control is a managed wrapper around a component installed with Internet Explorer how you car read in this link:
https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.webbrowser.version?view=netframework-4.7.2

When you try open with IE the page you have the same error?
Shaun VermaakSenior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019

Commented:
Use CefSharp browser instead
https://cefsharp.github.io/
rpm

Author

Commented:
DevAdmin:

The page works fine in IE

Shaun Vermaak:

I'll give that a go, thanks.
DevAdminSystem Engineer | .NET Developer | Microsoft MVP | Technical Speaker
CERTIFIED EXPERT

Commented:
Try read this post abount Controlling WebBrowser Control Compatibility
https://blogs.msdn.microsoft.com/patricka/2015/01/12/controlling-webbrowser-control-compatibility/
rpm

Author

Commented:
No idea what to take from that document!
DevAdminSystem Engineer | .NET Developer | Microsoft MVP | Technical Speaker
CERTIFIED EXPERT

Commented:
Read the part about the registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
rpm

Author

Commented:
I've followed the instructions for CEF, installed the NuGet package and set the target CPU to X64.

I then try to add a ChromiumWebBrowser component onto Form1, and I get the following error:

Failed to load toolbox item 'ChromiumWebBrowser'. It will be removed from the toolbox.

What am I doing wrong?
rpm

Author

Commented:
Tried and failed to follow that document section.
Senior Consultant
CERTIFIED EXPERT
Awarded 2017
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions