Note: Advice in this article will only work for DotNetBrowser 1.
See the corresponding API documentation for DotNetBrowser 2 here.
The following sample code demonstrates how to change the value of a particular node.
C#
using DotNetBrowser; using DotNetBrowser.DOM; using DotNetBrowser.Events; //... Browser browser = BrowserFactory.Create(); browser.FinishLoadingFrameEvent += delegate(object sender, FinishLoadingEventArgs e) { if (e.IsMainFrame) { DOMDocument document = e.Browser.GetDocument(); DOMElement button = document.GetElementById("button-id"); button.Children[0].NodeValue = "New Button Name"; } }; browser.LoadHTML("<html><body><button id='button-id'>Button</button></body></html>");
VB.NET
Imports DotNetBrowser Imports DotNetBrowser.DOM '... Dim browser As Browser = BrowserFactory.Create() AddHandler browser.FinishLoadingFrameEvent, sub(o, e) If e.IsMainFrame Then Dim document As DOMDocument = e.Browser.GetDocument() Dim button As DOMElement = document.GetElementById("button-id") button.Children.Item(0).NodeValue = "New Button Name" End If End sub browser.LoadHTML("<html><body><button id='button-id'>Button</button></body></html>")