in a webbrowser control, how can I invoke a specific "submit" button? So if I have a button on the webpage its showing, and I know the name of it, how can I click on it as if I were?
:)
Printable View
in a webbrowser control, how can I invoke a specific "submit" button? So if I have a button on the webpage its showing, and I know the name of it, how can I click on it as if I were?
:)
you dont even need to submit the button itself, you can submit the form
jsut do document.MyFormName.submit()
actually I cannot find that at all, ive been through it, in the webbrowser control properties/code
ok to make it clear. If I have this code in an html page, and its showing in the webbrowser control:
<input type="image" src="images/home/submit.gif" value="submit" border="0">
I want to be able to click on it, as if I were clicking manually, but wish to do this programmatically using the webbrowser control in .NET 2.0
resolved
simply get the elements by tag name of "Input", then go through each element, if the current element attribute value is "submit" then InvokeMember("click")
can you give an example of that
HtmlElements elements = this.webBrowserControl.GetElementsByTagName("Input");
foreach(HtmlElement currentElement in elements)
{
currentElement.InvokeMember("click");
}
so if have more button then how can click in what button i want ?
thats what the foreach loop does.... goes through all the html elements and called the invokemember method for "click"
you need to find your elements which are buttons or explicitly find the button by id then do an invoke member
If no one button have ID and how can do it ? You can give me a Exsample ? Thanks