473,587 Members | 2,324 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(@"htt p://www.mySite.com" );

Using this code:

private void Navigate2(Strin g address)
{
if (String.IsNullO rEmpty(address) ) return;
if (address.Equals ("about:blank") ) return;
if (!address.Start sWith("http://") &&
!address.Starts With("https://"))
{
//address = "http://" + address;
address = @"http://www.mySite.com" ;
}
try
{
webBrowser1.Nav igate(new Uri(address));
}
catch (System.UriForm atException)
{
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 8349
Use the DocumentComplet ed 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(@"htt p://www.mySite.com" );

Using this code:

private void Navigate2(Strin g address)
{
if (String.IsNullO rEmpty(address) ) return;
if (address.Equals ("about:blank") ) return;
if (!address.Start sWith("http://") &&
!address.Starts With("https://"))
{
//address = "http://" + address;
address = @"http://www.mySite.com" ;
}
try
{
webBrowser1.Nav igate(new Uri(address));
}
catch (System.UriForm atException)
{
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...@yaho o.yabbadabbadoo .comwrote:
Use the DocumentComplet ed 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(@"htt p://www.mySite.com" );
Using this code:
private void Navigate2(Strin g address)
{
if (String.IsNullO rEmpty(address) ) return;
if (address.Equals ("about:blank") ) return;
if (!address.Start sWith("http://") &&
!address.Starts With("https://"))
{
//address = "http://" + address;
address = @"http://www.mySite.com" ;
}
try
{
webBrowser1.Nav igate(new Uri(address));
}
catch (System.UriForm atException)
{
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...@yaho o.yabbadabbadoo .comwrote:
Use the DocumentComplet ed 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(@"htt p://www.mySite.com" );
Using this code:
private void Navigate2(Strin g address)
{
if (String.IsNullO rEmpty(address) ) return;
if (address.Equals ("about:blank") ) return;
if (!address.Start sWith("http://") &&
!address.Starts With("https://"))
{
//address = "http://" + address;
address = @"http://www.mySite.com" ;
}
try
{
webBrowser1.Nav igate(new Uri(address));
}
catch (System.UriForm atException)
{
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
6358
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 page once the form is launched. I now want to automatically fill out a specific text-field found within the web-page that the WebBrowser object has...
5
2760
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 but some default HTML. I want to copy the document and modify it before saving it to disk. So, I clone the document like this:
3
5539
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 (http://msdn.microsoft.com/library/default.asp?url=/workshop/security/szone/reference/enums/INTERNETFEATURELIST.asp and...
4
1461
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 Thanksgiving green bean casserole and not even one kid in the neighborhood has lost a toe this year! With these things in mind, I'd like to ask for...
4
12623
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 .DocumentStream, but this property is null. The property .DocumentText is = "" too. Am I missing something ? Thank you very much !
15
5671
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% on my machine, with the WebBrowser Class, and the Microsoft.MsHtml component. I can access all elements on the pages through the events, I can...
3
4047
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 Developersdex http://www.developersdex.com ***
3
3166
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 files are created and stored in a temp folder. The older files from temp need to be deleted everytime prior to calling the Navigate function for...
0
1831
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 to " "Url: about:blank" I am able to access the htc file when i run the host web page as a normal
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6621
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1185
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.