Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webBrowser control cannot find htmlElement after Ajax webpage update or in frame

Using webBrowser control in a winForm. but when the webpage is updated by Ajax or in a frame, I cannot use webBrowser1.document.getElementById, etc. to find that htmlElement. The element also won't show in the View->Source code in IE.

The untimate purpose is to find that htmlElement and simulate a click or other function like invokeMember("staff").

like image 237
Kevin Avatar asked Nov 15 '22 11:11

Kevin


1 Answers

The WebBrowser's Document object does indeed represent a live view of the DOM so there may be some other reason that you're unable to find it. DOM updates will not however be represented in View -> Source. You should use IE8's developer tools which will show you a live view of the DOM and maybe you'll see something like an incorrect/duplicate ID or something.

like image 64
Josh Avatar answered Dec 09 '22 16:12

Josh