I am trying to login to a website to automate checking the status of a few items. The problem that I am having is that even though I manage to populate the usernname/password fields (I can see that the username is correct, password is masked), I get the message that 

> 
> the login credentials are incorrect
> 
> 
> 

I have tried the following using the webbrowser component:

1. Manually enter the password and hit submit programmatically -failed
2. Manually enter username/password and hit submit programmatically -failed
3. Manually enter username/password and hit submit manually - got an error 
message but logged in.

The HTML code for the form, is similar to the following:

```
<input id="User" type="text" name="usrname" data-bind="value:username,returnKey:loginPageC" onkeydown="ClearEMessage()" tabindex="1">

<input id="Password" type="text" name="pass" data-bind="value:password,returnKey:loginPageC" onkeydown="ClearEMessage()" tabindex="1">

```

I have tried the following code, I have made sure that the correct button is clicked. Any idea on what am I doing wrong here? Thanks!!

```
HtmlDocument doc = webBrowser1.Document;
HtmlElement userName = doc.GetElementById("User");
HtmlElement pass = doc.GetElementById("Password");
userName.SetAttribute("value", "user123");
pass.SetAttribute("value", "pass321");
 HtmlElementCollection elc = this.webBrowser1.Document.GetElementsByTagName("input");
foreach (HtmlElement el in elc)
{
  if (el.GetAttribute("type").Equals("submit"))
  {
      el.InvokeMember("Click");
   }
}

```