How to click a button using axWebBrowser?

M

Michael

Hi experts,
I am using axWebBrowser in windows form to load web pages.
There is a page that contains a group of buttons. (More than 10
buttons.)
The source code behind each button is like below:

<input type="submit" name="Submit" value="Submit"
onClick="afm.__act.value='
SITE.9.20081206A__id.30.AdminsSelected.adp.actRegister';return
SubmitOnlyOnce();">

that is, all the buttons have the same name and value, but different
onClick event.

My question is, I want to click one of the buttons, how can I do this
in AxWebBrowser?
Thank you.

Regards,
Michael
 
K

kimiraikkonen

Hi experts,
I am using axWebBrowser in windows form to load web pages.
There is a page that contains a group of buttons. (More than 10
buttons.)
The source code behind each button is like below:

<input type="submit" name="Submit" value="Submit"
onClick="afm.__act.value='
SITE.9.20081206A__id.30.AdminsSelected.adp.actRegister';return
SubmitOnlyOnce();">

that is, all the buttons have the same name and value, but different
onClick event.

My question is, I want to click one of the buttons, how can I do this
in AxWebBrowser?
Thank you.

Regards,
Michael

Try this:
Click the button normally on a browser like IE or Firefox, after
loading is completed: Copy the whole addressbar and try to navigate to
this by passing proper value of your html element field(eg: Value
coming from textbox)

AxWebBrowser.Navigate("wholeURLfromAddressBar")

To clarify better:
When you click search on Google homepage, you get a URL that points to
your search, you can invoke the search directly using absolute URL
like:
http://www.google.com/search?hl=en&q=vb&aq=f&oq=

....and where "vb" is your search term. And in your AxWebBrowser, you
can change this term to what you want.

Hope this helps,

Onur Guzel
 
C

Cor Ligthert [MVP]

Michael,

The AxWebbrowser is nothing more than IE which is in the Windows OS.

As you click it gives to the server some information in a viewstate, in
javaScript, in flash or whatever.

You cannot process that either in IE or in the Axwebbrowser. As ozul told
you can see at the resulting url and then access that with by instance
processstart

Cor
 

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