title: NullReferenceException was unhandled on button_click [vb.net]
body: <p>I have a problem with my code. During debug mode, there is no error or warning at all. But when i pressed a button, an error comes up. This is my code:</p>
  
  <pre><code>Private Sub Button11_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
      Button1.Enabled = True
      Dim i As Integer
      For i = 0 To 10
  
  
          WebBrowser1.Document.GetElementById("login").SetAttribute("value", (TextBox1.Text))
          WebBrowser1.Document.GetElementById("saveBtn").InvokeMember("click")
  
     Next i
  End Sub
  </code></pre>