473,511 Members | 13,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Webbrowser component 'wait to load' help...

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

Feb 20 '07 #1
3 8339
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


"trint" wrote:
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

Feb 20 '07 #2
On Feb 20, 3:21 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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

"trint" wrote:
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- Hide quoted text -

- Show quoted text -
Thank you! I will try that. Yesterday I could not find one event
handler that changed
at all during debug from the page I wanted to a bad url.
Trint

Feb 21 '07 #3
On Feb 20, 3:21 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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

"trint" wrote:
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- Hide quoted text -

- 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

Feb 21 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6355
by: Matt | last post by:
Hi group, Here's a problem I've been trying to solve for the past several weeks. I have the standard WebBrowser object added to a form so it can access websites, and I have it load a default...
5
2751
by: Charles Law | last post by:
Sorry for the cross post, but I'm not sure who is best placed to answer this one. This is the most bizarre behaviour of MSHTML and streams. I have a WebBrowser control that contains nothing...
3
5530
by: Jim Hubbard | last post by:
I want to implement the same type of activeX restrictions in my browser application that the new SP2 for XP places in Internet Explorer. I have found 2 web pages dealing with this functionality...
4
1457
by: Jim | last post by:
Dear Santa, While it's true that I haven't been perfect this year, it's definitely an improvement over previous years. All cats still have their own fur, no hidden cat fur in this year's...
4
12609
by: Toma Marinov | last post by:
Hello ! I made some test with webbrowser control in VS.2005. When I load a word document in webbrowser through .Navigate method (from my hdd), I want to get the stream of the loaded doc file with...
15
5653
by: Laurent Lequenne | last post by:
Hello All, I'm currently developing a free windows Scrabble (in french :)) application that uses extensively the WebBrowser class of NET 2.0 for configuration, and data browsing. It works 100%...
3
4044
by: William Cruz | last post by:
Can I call a file (*.html) within My.Resources to show-up in my WebBrowser control? If so, please provide a sample code or a link. Thanks in advance for your help. William Cruz *** Sent via...
3
3164
by: =?Utf-8?B?R2F1cmF2?= | last post by:
I am using the AxSHDocVw.AxWebBrowser control (named PreviewBrowser) in my C# app to load a pdf file: PreviewBrowser.Navigate(strPDF ,ref objNull,ref objNull,ref objNull,ref objNull); These PDF...
0
1820
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
Hi, Is it possible to access an htc file from the windows webbrowser control? I am receiving the following error: "An error has occurred in the script on this page." "Error: Access is denied...
0
7251
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7148
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5673
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.