Reputation: 16829
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?
Upvotes: 3
Views: 33426
Reputation: 8760
You can do something like this:
String newValue = "Sample Text";
HtmlElement txt = WebBrowser1.Document.GetElementById("ElementIdOnHtmlPage");
txt.SetAttribute("value",newValue);
Upvotes: 2
Reputation: 43207
You can do the browser automation in C# for WebBrowser control.
Here's the reference article explaining how you can do that.
http://www.codeproject.com/KB/cs/mshtml_automation.aspx
Upvotes: 1
Reputation: 50712
HtmlDocument doc = this.webBrowser1.Document;
doc.GetElementById("myId").SetAttribute("Value", "someValue");
try this
Upvotes: 10