tags:

views:

111

answers:

2

Suppose we have a combo box in a web page which have 24 options in its drop down. I have loaded the page in a web browser control hosted in a windows application. Now how can I populate all the options for the combo box using its tag by C#?

A: 

I am not 100% sure what you want, but if you want to display the combobox options from the web in a win forms application I suggest to make a webservice that supplies the options.

So instead of using the web browser controle, you call the webservices and add the response to the windows froms combo.

If that is not an option, you can always do a Webrequest to the page that is in the webbrowser and screen scrape the combobox options

Ivo
A: 

Assuming you can access the html source code of the page in question you can without much trouble dig out the tags of the dropdown selection box from that code.

A fairly simple regex matching should be able to return all the options. If you are unfamiliar with regex it would be beneficial if you could provide a little more detail about the code in question.

omglolbah
Thanks guys for your replies. Basically there is no specific web page I am working on. I am working on a generic web form submitter, where there are combo boxes and I have to select a value from the combo box options depending on some parameters. And about regex, I wanted to know is there any generic regex pattern to select the values from the html source, coz as I said, I am not working on a particular web page.Thanks again for your time.
Anindya Chatterjee