Webbrowser component 'wait to load' help...

  • Thread starter Thread starter trint
  • Start date Start date
T

trint

Note: My question is after the following code.
I have this call:

Navigate2(@"http://www.mySite.com");

Using this code:

private void Navigate2(String address)
{
if (String.IsNullOrEmpty(address)) return;
if (address.Equals("about:blank")) return;
if (!address.StartsWith("http://") &&
!address.StartsWith("https://"))
{
//address = "http://" + address;
address = @"http://www.mySite.com";
}
try
{
webBrowser1.Navigate(new Uri(address));
}
catch (System.UriFormatException)
{
return;
}
}

Ok, all I want is for the next call to wait until the web site is
fully loaded
into the control. The way it is working now, it just keeps going even
if the call (above)
has not fully loaded the site.
Any help is appreciated.
Thanks,
Trint
 
Use the DocumentCompleted event handler and put your business logic that
depends on fully loaded document there.
Peter
 
Use the DocumentCompleted event handler and put your business logic that
depends on fully loaded document there.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net







- Show quoted text -

One more thing! How can I pick out something in the webBrowser1 that
I can determine this is
my website loaded and not the "The page cannot be displayed" or some
other failure?
That is what I'm really after and cannot find anything about
Mysite.com really loaded or
like if the site is down, the page cannot be displayed? I really want
to know how to get the
difference please.
Thanks,
Trint
 
Back
Top