title: Not able to set Url property at runtime in webbrowser control
body: <p>I have a <code>webbrowser</code> control in my Winform application.</p>
  
  <p>Below regions belong to division of code sample.</p>
  
  <p><strong>Region 1</strong>
  The current url page loaded is "<a href="http://MyWebsite.com" rel="nofollow">http://MyWebsite.com</a>". I am clicking a link (say "About Us") in the web page using code. This click will take me to new url page ("<a href="http://MyWebsite.com/About_Us" rel="nofollow">http://MyWebsite.com/About_Us</a>"). In Navigating event I am recording this new url.</p>
  
  <p><strong>Region 2</strong>
  Now I want to get all elements of this new url and click on a new link. But not sure how to do it. In Region 2 I am also assigning the new url to webbrowser object. But nothing reflects in the instance. <code>webbrowser.url</code> still contains the previous url path.</p>
  
  <p>I have following code for button click:</p>
  
  <pre><code>    private void Button1Click(object sender, EventArgs e)
      {
          // Region 1---------------------------------------------
          HtmlElementCollection links = webBrowser1.Document.GetElementsByTagName("A");
          foreach (HtmlElement link in links)
          {
              if (link.InnerText != null &amp;&amp; link.InnerText.Equals("Click to view magic"))
              {
                  link.InvokeMember("Click");
                  break;
              }
          }
          // EndRegion---------------------------------------------
  
  
          // Region 2---------------------------------------------
          webBrowser1.Url = new Uri(_url.AbsoluteUri, UriKind.Absolute);
          webBrowser1.Navigate(_url); //New Edit
  
          links = webBrowser1.Document.GetElementsByTagName("input");
          foreach (HtmlElement link in links)
          {
              if ((link.GetAttribute("Name") == "BooHoo"))
              {
                  link.InvokeMember("Click");
                  break;
              }
          }
          // EndRegion---------------------------------------------
      }
  
      private void WebBrowser1Navigating(object sender, WebBrowserNavigatingEventArgs e)
      {
          _url = e.Url;
      }
  </code></pre>
  
  <p>Can anyone help me to do this. The question may not be very clear. Please let me know if you need any further details. Thanks.</p>