title: C#: Accessing and Modifying Values in a WebBrowser Control
body: <p>I have a WebBrowser control where I want to edit a field in the HTML and then submit a form. Let's say that the field is called <code>txtUname</code> and that the submit button is called <code>submit</code> in form <code>form1</code>. How can I do this?</p>
  
  <p>I'm currently thinking of using something like this, but I haven't tested it:</p>
  
  <pre><code>//Change value
  
  webBrowser1.Document.getElementbyId("txtUname").setAttribute("value","this is my value");
  
  //Submit form
  
  webBrowser1.Document.Forms("form1").invokeMember("submit");
  </code></pre>
  
  <p>In addition, does this work for any type of field?</p>
  
  <p>Also, is it possible to do something similar inside a WebClient?</p>