Welcome Guest Search | Active Topics | Sign In | Register

Help with just a few things please Options
lolikols
Posted: Thursday, September 3, 2020 4:20:20 PM
Rank: Newbie
Groups: Member

Joined: 9/3/2020
Posts: 2
Hello folks,

I'm having trouble with a few things. I'm using Visual Studio 2019, C#, Winforms.

Firstly, I read online that if I'm going to be working with iFrames, that I should set BrowserOptions like so:
Quote:
EO.WebBrowser.BrowserOptions options = new EO.WebBrowser.BrowserOptions();
options.EnableWebSecurity = false;
EO.WebBrowser.Runtime.SetDefaultOptions(options);

However, I'm getting a "The type or namespace name 'BrowserOptions' does not exist in the namespace 'EO.WebBrowser'". So I did a little more digging, and I read that I need to reference some .dll files. However, I installed EO.WebBrowser from the Manage NuGet Packages section in Visual Studio, so there aren't any .dll files to reference. I did find some .dll files in project > packages > EO.WebBrowser.20.2.34 > lib, but I don't seem able to add those as references. Any one have any idea what I'm doing wrong with this one?


Secondly, I'm going to be working with elements (mostly radiobuttons, dropdowns, and textboxes) that are sometimes inside an iFrame and sometimes not inside an iFrame. I found that the below code works wonderfully for items not in an iFrame:
Quote:
webView1.EvalScript("document.getElementById('element').value = 'text';");

I read online that the below code will work for iFramed items:
Quote:
webView1.EvalScript("frames[frame_name].document.getElementById('user_name_id').value='user_name';");


However, is there a way for me to check if an element exists on a page (iFrame and not iFrame)? I need to run a series of code once my application has determined that a particular element exists, and no amount of Googling is providing me with a solution :(.
eo_support
Posted: Friday, September 4, 2020 7:47:29 AM
Rank: Administration
Groups: Administration

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

BrowserOptions is in EO.WebEngine namespace, not EO.WebBrowser namespace. So please change EO.WebBrowser.BrowserOptions to EO.WebEngine.BrowserOptions.

You can check whether an element exists with JavaScript. However since JavaScript is a general web programming topic, we do not provide any tech support on that. You can search online on how to check if an element exists with JavaScript and you should be able to find plenty of information about it.

Thanks!


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.