webbrowser send text to control

D

David A. Beck

I need to enter data on a web page. I have been able to navigate using the
VB.NET WebBrowser control and see the contents of each page. What I need to
do now is to fill in the controls on the page with text and send an <enter>
key. If WebBrowser can't do this, does anyone know of a different managed
control that can do this?

Dab
 
J

Jonathan Boivin

Hi,

Here is the code I use to call a JavaScript a the page. So you can create a
function in JavaScript which will to the change on the form with the
arguments passed to it.

Dim MyWin As IHTMLWindow2 = PageForText.Document.parentWindow

MyWin.execScript("SetHTML(""" & HTML.Replace("""", "\""") & """);",
"javascript")


Mine was used with only one paramater, but you can do what you want.

You will need to have a reference to Interop.SHDocVw and AxInterop.SHDocVw.
(If you need those tell me I'll send 'em to you). These are for the old
browser version, but it's working really fine.
 
D

David A. Beck

I'm using this to fill in data on a web page controlled by someone else from
a VB.NET program. I'm struggling with how I would use JavaScript in this
context. Can you help me understand?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top