Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hi i used a geckowebbrowser for loadnig a page in my form windows application
i did this with IE and webbrowser control and when this form load my target page
i filled the textbox of forms and click the button programmatically
with this commands

wb is instance of webbrowser
C#
htmlelement usr=wb.Document.All["TXTCONTROL id"]
usr.innertext="MY DATA";

wb.document.getelementbyid("BUTTON NAME").invokmember("click");

now how do it with geckowebbrowser?
please help me
thanks
Posted
Updated 29-May-12 1:00am
v2

1 solution

                    geckoWebBrowser1.DomDocument.GetElementById("IdHere").SetAttribute("value", textBox1.Text);
                    geckoWebBrowser1.DomDocument.GetElementById("IdHere").SetAttribute("value", textBox2.Text);

GeckoHtmlElement SwagSubmitField =
      (GeckoHtmlElement)geckoWebBrowser1.DomDocument.GetElementById("loginBtn");
SwagSubmitField.Click();

//Custom Function To wait for two seconds, To make sure that "Click" is registered 
//be for going to next action
Ticker.Time(2);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900