title: webBrower Button Click without element ID?
body: <p>I'm working on a login system for a forum and trying to make it work via a c# .net form. I need to programitically click the login button on the forum with a webBrower control. So far I have this.</p>
  
  <pre><code>webPage page = new webPage(); 
  page.URL = txtURL.Text;
  page.Load();  //Load the text from the specified URL
  WebBrowser browser = new WebBrowser();
  browser.Document.GetElementById("navbar_username").SetAttribute("value", textBox1.Text);
  browser.Document.GetElementById("navbar_password").SetAttribute("value", textBox2.Text);
  
  HtmlElement el = browser.Document.All["btnI"];
  if (el != null)
  {
      el.InvokeMember("click");
  }
  else
  {
      MessageBox.Show("There is an issue with the program");
  }
  </code></pre>
  
  <p>The issue is that the login button on the page does not have an ID or any real information that can allow me to click on it. Does anyone have any suggestions? Here is the code for the login button.</p>
  
  <pre><code>&lt;input type="image" src="images/loginbutton.png" class="loginbutton" tabindex="104" value="Log in" title="Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself." accesskey="s"&gt;
  </code></pre>