Is there a way to take the value of a string and pass that to a textbox within a web page while using the webbrowser control?
+2
A:
HtmlDocument doc = this.webBrowser1.Document;
doc.GetElementById("myId").SetAttribute("Value", "someValue");
try this
ArsenMkrt
2009-10-21 04:59:29
Thanks. Another tiny related question. How would I press a button within a webpage as well?
Nate Shoffner
2009-10-21 07:01:06
invoke click like this..webBrowser1.Document.GetElementById("myBtn").InvokeMember("click");
ArsenMkrt
2009-10-21 07:03:30
Whoops, meant to update this. I got it shortly after I asked. Thanks for all your help.
Nate Shoffner
2009-10-21 08:28:16
A:
You can do the browser automation in C# for WebBrowser control.
Here's the reference article explaining how you can do that.
this. __curious_geek
2009-10-21 05:04:09
+1
A:
You can do something like this:
String newValue = "Sample Text";
HtmlElement txt = WebBrowser1.Document.GetElementById("ElementIdOnHtmlPage");
txt.SetAttribute("value",newValue);
jerjer
2009-10-21 05:07:06