Link to home
Start Free TrialLog in
Avatar of jes12345
jes12345

asked on

Update html TEXTAREA from VB.NET in WebBrowser object

I have loaded a html page into a webbrowser object and I want to add some text to the textarea field on the html page. However when I run the code below the text is not added to the textarea. Do I need to run some kind of update or similar to update the web page or am I using the wrong method?
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("textarea")

For Each curElement As HtmlElement In theElementCollection
Dim controlName As String = curElement.GetAttribute("name").ToString
                If controlName = "TheNameOfTheField" Then
                   curElement.InnerHtml = "test"
                End If
            Next

Open in new window

Avatar of StealthyDev
StealthyDev

Are you writing this in server?
Avatar of jes12345

ASKER

No this is a client app..
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks