If I have an application [c#] with a web browser control in it and I want to fill the first text area with information on a click off a button. How would I do it?
How would I auto fill a textArea in C# with a web browser if it has
<textarea class="profile" name="message"></textarea><br />
But no ID field set?
[C#]
private void messageToolStripMenuItem_Click(object sender, EventArgs e)
{
webBrowser1.Document
.GetElementsByTagName("textarea")
.GetElementsByName("message")[0]
.SetAttribute("value", "Something");
// HtmlDocument doc = this.webBrowser1.Document;
// doc.GetElementsByTagName("textarea")[0].SetAttribute("Value", "a");
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
MessageBox.Show("LoadedLux");
webBrowser1.Document
.GetElementsByTagName("input")
.GetElementsByName("q")[0]
.SetAttribute("value", "Something");
}
then I could use document.GetElementById("box").SetAttribute("Value", "ThisNewBox"); But What if there was no ID SET? – user1999321 Apr 23 '13 at 03:01