I am opening a website in a web browser control in vb.net 2008 . I want to programatically fill a form which is on the 3rd page of the website . But my code is unable to fill it . Can u plz guide me . I am using the following code
Public Class Form1
Dim timercount As Integer = 1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
WebBrowser1.Navigate("bla bla bla")
End Sub
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
Dim txti As HtmlElement = WebBrowser1.Document.GetElementById("txtId")
Dim txtp As HtmlElement = WebBrowser1.Document.GetElementById("txtPsw")
Dim txti1 As HtmlElement = WebBrowser1.Document.GetElementById("txtId1")
Dim txtd As HtmlElement = WebBrowser1.Document.GetElementById("txtDate")
Dim txtr As HtmlElement = WebBrowser1.Document.GetElementById("txtRegion")
Dim txte As HtmlElement = WebBrowser1.Document.GetElementById("txtEmail")
Dim txtt As HtmlElement = WebBrowser1.Document.GetElementById("txtTitle")
Dim txtu As HtmlElement = WebBrowser1.Document.GetElementById("txtUrl")
Dim txtp1 As HtmlElement = WebBrowser1.Document.GetElementById("txtPin1")
Dim txtp2 As HtmlElement = WebBrowser1.Document.GetElementById("txtPin2")
Dim txtp3 As HtmlElement = WebBrowser1.Document.GetElementById("txtPin3")
Dim txtp4 As HtmlElement = WebBrowser1.Document.GetElementById("txtPin4")
Dim txtp5 As HtmlElement = WebBrowser1.Document.GetElementById("txtPin5")
Dim txtpd As HtmlElement = WebBrowser1.Document.GetElementById("txtData")
txti.SetAttribute("value", "E712050-15")
txtp.SetAttribute("value", "HH29")
txti1.SetAttribute("value", "E712050-15")
txtd.SetAttribute("value", "")
txtr.SetAttribute("value", "PAKISTAN")
txte.SetAttribute("value", "excitedreams@yahoo.com")
txtt.SetAttribute("value", "Best Classified Business.")
txtu.SetAttribute("value", "// www.craigslist.org /")
txtp1.SetAttribute("value", "W")
txtp2.SetAttribute("value", "X")
txtp3.SetAttribute("value", "M")
txtp4.SetAttribute("value", "A")
txtp5.SetAttribute("value", "F")
End sub
End class