Home All Groups Group Topic Archive Search About

AxWebBrowser1 and code behind redirecting

Author
12 Apr 2005 4:09 PM
foldface
Hi
  I'm using the AxWebBrowser1 control. I use the
event DocumentComplete to tell when a document has downloaded
which works fine, except when thw web page does something
like this:

HttpContext.Current.Response.Redirect(url, true);

I can't seem to find an event on the AxWebBrowser1 control that fires
in this case.
  I could setup a heartbeat thread to detect when the page changes
but thats a hack fix, is there a good way of doing this?

ta
f

Author
12 Apr 2005 5:00 PM
Cor Ligthert
Foldface.

A document complete fires when there is any frame downloaded. A document is
not a page, however a frame.

Therefore what I do for frames is set them as documents in an arraylist
every time this event fires.
\\\

Dim wb As SHDocVw.WebBrowser = DirectCast(e.pDisp,
SHDocVw.WebBrowser)myArraylistDocuments.Add(wb.Document)

///

I don't know if that takes as well the redirected pages and am therefore
curious about that.

Cor
Author
12 Apr 2005 5:17 PM
Cor Ligthert
\\\
Dim wb As SHDocVw.WebBrowser = DirectCast(e.pDisp,  _
SHDocVw.WebBrowser)
myArraylistDocuments.Add(wb.Document)
///
Author
13 Apr 2005 10:21 AM
foldface
"Cor Ligthert" <notmyfirstn***@planet.nl> wrote in message news:<eeSiKO4PFHA.1500@TK2MSFTNGP09.phx.gbl>...
> \\\
> Dim wb As SHDocVw.WebBrowser = DirectCast(e.pDisp,  _
> SHDocVw.WebBrowser)
> myArraylistDocuments.Add(wb.Document)
> ///

I'm sorry but I don't understand what your saying. Could you explain that
again? What your doing and what you expect the affect to be?

thanks for the response

f
Author
13 Apr 2005 10:28 AM
Cor Ligthert
Foldface

Did you look at the message before this. The message you showed is a correction from a wrong formatted text while sending.

Cor
Author
15 Apr 2005 8:57 AM
foldface
Cor Ligthert wrote:
> Foldface
>
> Did you look at the message before this. The message you showed is a
correction from a wrong formatted text while sending.
>
> Cor

Sorry, I saw both messages but what I was asking was what this actually
means? I just couldn't understand
what it was trying to accomplish. It looks like your just adding the
document to your own
private list.
  Incidently I'm a c# coder rather than a VB coder. I can read the code
but if myArraylistDocuments means
something other than a local variable I wouldn't know. I can't just try
it because I can't understand it.

Thanks for the response
F
Author
15 Apr 2005 9:34 AM
Cor Ligthert
>
> Sorry, I saw both messages but what I was asking was what this actually
> means? I just couldn't understand
> what it was trying to accomplish. It looks like your just adding the
> document to your own
> private list.

This I wrote
>>Therefore what I do for frames is set them as documents in an arraylist
>>every time this event fires.

When you don't understand it, than I tell it in another way

A Webpage can exist as more frames. What I do is set the received documents
(which can be a part of a webpage by instance frames) as document in an
arraylist (which is an IList implementing class). After that I process the
documents in the arraylist. I assume that it will take as well more
documents as those exist because of a redirect. However, that I never tried.

This is the code I use for that in VBNet inside the documentcomplete event
of a AXwebbrowser.

Dim wb As SHDocVw.WebBrowser = DirectCast(e.pDisp,  _
SHDocVw.WebBrowser)
myArraylistDocuments.Add(wb.Document)

>Incidently I'm a c# coder rather than a VB coder

Although it is very easy for me to translate this in C#, is it something I
do not do in this language.vb newsgroup. Than you would have asked this
question in newsgroups like dotnet.general or dotnet.languages.csharp. The
only difference is by the way the declaration and the cast

SHDocVW.WebBrowser wb = (SHDocVW.Webbrowser) e.pDisp;

Anyway I hope this helps,

Cor