Re: How can I know when the URL I specified to Navigate method get loaded?
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Sat, 12 Apr 2008 11:01:04 -0400
"yuzhu.shen" <yuzhu.shen@xxxxxxxxx> wrote in message
news:752b278b-537c-4d42-8921-6e982d72276b@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
I ask the control to navigate with a url "http://foo.bar", then I want
to get the notification when it gets loaded (say, in
NavigateComplete2()).
If you want to know when the page is fully loaded, wait for
DocumentComplete event.
Approach (1) Since the input URL of NavigateComplete2 may have been
modified (by server side redirection, etc.), I cannot test whether
this URL equals to "http://foo.bar".
The first parameter of NavigateComplete2 (and DocumentComplete) is the
IWebBrowser2 pointer of the browser firing the event. Just check that
it's the same one you've navigated in the first place.
Approach (2) After I invoke Navigate(), I just treat the NEXT
NavigationComplete2 on the top-level frame to be the "http://foo.bar".
However, I think this may be wrong in some rare too, here is an
example:
Invoke Navigate() with "http://not.foo.bar" --> Invoke Navigate() with
"http://foo.bar" --> OnNavigateComplete2( "http://not.foo.bar" ) -->
OnNavigateComplete2( "http://foo.bar" )
If you call Navigate again on the same browser, any previous navigation
still in progress will be aborted, and you won't get NavigateComplete2
event for it.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- Follow-Ups:
- References:
- Prev by Date: How can I know when the URL I specified to Navigate method get loaded?
- Next by Date: Re: How can I know when the URL I specified to Navigate method get loaded?
- Previous by thread: How can I know when the URL I specified to Navigate method get loaded?
- Next by thread: Re: How can I know when the URL I specified to Navigate method get loaded?
- Index(es):
Relevant Pages
|
|