Re: How can I know when the URL I specified to Navigate method get loaded?



Hi, Igor.

Thanks for reply!

I am sorry maybe I didn't state my question clearly.

I want to know how to associate a NavigateComplete2 event (or
something like that) with the original request. Put it in other words,
I use Navigate() to ask the control to navigate to some URL, and I
want to know if it is get loaded (if yes, when it is get loaded).

For example, I Navigate() with "http://foo.bar";, then I want to konw
if this "http://foo.bar"; really takes effect. (including the case that
the source URL has changed with server redirection).

Case 1: The URL takes effect:
Navigate() with "http://foo.bar"; --> I get a NavigateComplete2() for
"http://foo.bar/";, and I know (by some way) that this URL is specified
by me. --> "http://foo.bar"; takes effect!

Case 2: The URL takes effect:
Navigate() with "http://foo.bar"; --> I get a NavigateComplete2()
for "http://redirect.foo.bar";, but I know (by some way) that this URL
is redirected from "http://foo.bar";. --> Great! "http://foo.bar";
takes effect!

Case 3: The URL doesn't take effect:
Currently in page A --> Invoke Navigate() with "http://foo.bar"; -->
Very quickly click a link to "http://not.foo.bar"; in page A --> I get
a NavigateComplete2() for "http://not.foo.bar";. By some way, I know
that this "http://not.foo.bar"; is not related to my original request.
--> OK, "http://foo.bar"; doesn't take effect.


On Apr 13, 8:51 pm, "Igor Tandetnik" <itandet...@xxxxxxxx> wrote:
"yuzhu.shen" <yuzhu.s...@xxxxxxxxx> wrote in message

news:24f4ec88-09d7-4b31-8015-85e268610d4b@xxxxxxxxxxxxxxxxxxxxxxxxxxx

I thinked up another example this time ( and tested it ).

============================
Currently in page A --> Invoke Navigate() with "http://foo.bar"; -->
Very quickly click a link to "http://not.foo.bar"; in page A -->
OnNavigateComplete2("http://not.foo.bar";)
=============================

Right. That's precisely what I predicted would happen. What again seems
to be the problem?

In this case, I still cannot determine by the NEXT
OnNavigateComplete2() that "http://foo.bar"; gets loaded.

But of course. It _never_ gets loaded in your scenario. What else did
you expect?

What exactly are you trying to achieve?

Or, if the url I navigate is not a HTML page, instead it is an exe
file.

============================
Currently in page A --> Invoke Navigate() with "http://foo.bar/a.exe";
--> (no OnNavigateComplete2() for "http://foo.bar/a.exe";) --> Some
time later, user click some link or input some other url to navigate
--
OnNavigateComplete2("http://still.not.foo.bar";).
=============================

I still fail to see the problem with this scenario (or any other you
have propounded).

According to these examples, I think approach (2) is still
problematic: after I invoke Navigate() with "http://foo.bar";, I cannot
just treat the NEXT NavigationComplete2 on the top-level frame to be
the "http://foo.bar";.

I never suggested you should.
--
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

.



Relevant Pages