Programatically click a web page button

G

Guest

Using C# and a web browser control, is there a way to programatically click a
web page button?
 
G

Guest

No, C# runs on the server, a button click occurs on the client. Try some
javascript.

..NET DLLs can be hosted as objects (like Java applets) in IE, but I don't
think that's what you're talking about.
 
G

Guest

Pete,
Yes, assuming you have navigated the webBrowser control to the requested
page, and then obtained an DOM reference to the page model, you can use DOM
methods to call the submit method on the submit button of a form control, for
example.

But the real question is what do you *really* want to do? If this button
submits a form, you don't even need a webbrowser control for that. You can
simply construct a POST WebRequest with the correct multipart enctype and
send it out.
Peter
 
G

Guest

Thanks for the response. I will look at how to use the DOM reference as you
suggested. I did try it but didn't get too far and had wondered if there was
an easier way.

What I really want to do:

Basically, a windows form program that can aceess secure sites (that I have
valid access to) and mine some data.
I wanted to use HttpWebRequest/Response but couldn't figure out how to use
for https: sites.
Most sites want userid/password, some want userid/pword/pin.
I haven't been able to find a guide to show me how to handle logon info,
site redirection, cookies, etc (at least not that I could follow well enoguh
to get to work).
So, I thought the easiest way to accomplish would be to fill in login data
on the form using HtmlElement, and then submit the form by clicking the
button.

Filling in the form was easy, clicking the button not so easy.

If you have any good (hopefully relatively easy to follow) reference on how
to do this more efficiently, that would be great.

Thanks again,
Pete
 

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