title: Wait for loading page after button click
body: <p>I want to be able to click on button and than wait for the page to load. 
  I search, but there is no solution that work correctly.
  This is part of code:</p>
  
  <pre><code>el = webBrowser1.Document.GetElementById("LoginButton");
  el.InvokeMember("click");
  webBrowser1.Navigate(url);
  </code></pre>
  
  <p>I need it to be that after click, the application will load the page, and only then go to another page. 
  Also, <code>webBrowser1.Navigate(url)</code> must be in the same method as click. Because it all in a loop.</p>
  
  <p>Please help.</p>
  
  <p><strong>EDITED.</strong>
  *<em>More code</em>* (first code was and example of what i need)</p>
  
  <pre><code>List&lt;string&gt; list1 = new List&lt;string&gt;();
  
              bool flag = true;
  
              while (flag)
              {
                  flag = false;
  
                  foreach (HtmlElement he2 in webBrowser1.Document.GetElementsByTagName("a"))
                  {
                      if (he2.GetAttribute("href").Contains("profile.php?ID="))
                      {
                          list1.Add(he2.InnerText);
                      }
  
                  }
  
                  foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("a"))
                  {
  
                      if (he.InnerHtml == "Next")
                      {
                          flag = true;
  
                          he.InvokeMember("click");
  
  
                      }
                  }
  
  
              }
  </code></pre>
  
  <p>When I click, next page must load, and i have to parse tag on next page, but it begin parse page before next page is load, so it parse the same page.</p>