WebBrowser DocumentCompleted Empty Document

G

Guest

I have a user control that contains an instance of the .net 2.0 webbrowser
control. I have hooked the DocumentCompleted of the browser so that I can
parse through the HTML of the loaded webpage.

I am having a problem that every once in awhile (I have not been able to
determine a pattern) the webbrowser.Document of my webbrowser instance is
null when the DocumentCompleted event fires. The document itself is not part
of the eventargs so I can't get it that way.

I have tried looking at it through the sender of the event and it is null
this way as well.

Has anyone run into this before? Is the documentCompleted the wrong event?
It seems the only other choice is Navigated, but that the document contents
are not populated yet in this event.

I am working on a simple reproducible case. But, haven't gotten it yet.
Just curious if I am on the wrong track or if this is a known issue.

Appreciate any help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top