Hello,
I'm hoping someone can help. I have an html document with three frames, topFrame, middleFrame, and bottomFrame. I have the document loading in a webBrowser control in VB .net 2005. I have a button on my form and when the button is clicked, I want to add text to a text box in the bottom frame. All documentation on MSDN and what I have found online shows that the following simple code should work, but I get an error message when the button is clicked. Please help if you can. Here is the code I am trying to execute:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hElement As HtmlElement = WebBrowser1.Document.GetElementById("parent.bottomFrame.document.getElementById('text')")
hElement.SetAttribute("value", "test")
End Sub
The error (NullReferenceException was Unhandled) that is displayed has to do with the .SetAttribute line. Thanks in advance. -gk
I'm hoping someone can help. I have an html document with three frames, topFrame, middleFrame, and bottomFrame. I have the document loading in a webBrowser control in VB .net 2005. I have a button on my form and when the button is clicked, I want to add text to a text box in the bottom frame. All documentation on MSDN and what I have found online shows that the following simple code should work, but I get an error message when the button is clicked. Please help if you can. Here is the code I am trying to execute:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hElement As HtmlElement = WebBrowser1.Document.GetElementById("parent.bottomFrame.document.getElementById('text')")
hElement.SetAttribute("value", "test")
End Sub
The error (NullReferenceException was Unhandled) that is displayed has to do with the .SetAttribute line. Thanks in advance. -gk