Help with strange WebBrowser control problem...

D

David

I'm using the AxSHDocVw.WebBrowser control to download data from a webpage
at work (it's an internal page on my company's intranet).

The page produces a runtime error after a while and the strange thing is
that until the page is refreshed with Internet Explorer, the error keeps
occurring. I realize no one can debug an application that I can't even
provide details about (I didn't write nor do I have access to it) but what
difference would it make if I used .Refresh with the WebBrowser control
(I've also tried the other WebBrowser control in the toolbox) versus
refreshing with IE? I can refresh IE on the computer the VB program is
running on or any other computer on the network- either option stops the
page from returning a runtime error. I've even tried creating a second
control to refresh the page after the error starts occurring but this has
not helped at all.

Any ideas?

(Using Visual Studio 2005 / VB. The page is coded in VB2005/ASP.)
 
T

Tom Shelton

I'm using the AxSHDocVw.WebBrowser control to download data from a webpage
at work (it's an internal page on my company's intranet).

The page produces a runtime error after a while and the strange thing is
that until the page is refreshed with Internet Explorer, the error keeps
occurring. I realize no one can debug an application that I can't even
provide details about (I didn't write nor do I have access to it) but what
difference would it make if I used .Refresh with the WebBrowser control
(I've also tried the other WebBrowser control in the toolbox) versus
refreshing with IE? I can refresh IE on the computer the VB program is
running on or any other computer on the network- either option stops the
page from returning a runtime error. I've even tried creating a second
control to refresh the page after the error starts occurring but this has
not helped at all.

Any ideas?

(Using Visual Studio 2005 / VB. The page is coded in VB2005/ASP.)

I'm not sure what would be causing this issue - but are using the
control to just download data or are you also using it to display the
data? If you simply downloading it, you might want to look at the
System.Net.WebClient class. In fact, even if your displaying the
data, maybe you could use this class to download it to a local file,
and then load that into the webbrowser control?

Just a thought.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

David said:
I'm using the AxSHDocVw.WebBrowser control to download data from a webpage
at work (it's an internal page on my company's intranet).

The page produces a runtime error after a while and the strange thing is
that until the page is refreshed with Internet Explorer, the error keeps
occurring. I realize no one can debug an application that I can't even
provide details about (I didn't write nor do I have access to it) but what
difference would it make if I used .Refresh with the WebBrowser control
(I've also tried the other WebBrowser control in the toolbox) versus
refreshing with IE? I can refresh IE on the computer the VB program is
running on or any other computer on the network- either option stops the
page from returning a runtime error. I've even tried creating a second
control to refresh the page after the error starts occurring but this has
not helped at all.

Any ideas?

(Using Visual Studio 2005 / VB. The page is coded in VB2005/ASP.)

Check the url that you get for the error message. If you get redirected
to an error page, you don't get back to the original page by refreshing
the error page.

Check if there is a method to refresh the page and not use the cache,
equivalent of pressing ctrl+f5 in the browser.
 
D

David

Göran Andersson said:
Check the url that you get for the error message. If you get redirected to
an error page, you don't get back to the original page by refreshing the
error page.

Check if there is a method to refresh the page and not use the cache,
equivalent of pressing ctrl+f5 in the browser.

The "main" web page is a list of service requests links. My program is
loading the main web page and then loading each individual service request
link. At various points (seems to be random), when attempting to load a
service request page, a runtime error is returned. I've tried slowing the
program down and am convinced the time between downloading each page is not
the cause of the problem.

When the runtime error is returned, I try downloading the same service
request page again after waiting 30 seconds. The runtime error will
continue to be returned.

If I open an instance of IE and load the "main" web page, the runtime error
is not returned and the program continues. IE can be used to load the
"main" web page on the computer running the program or on a different
computer, same results.

What confuses me is why I can not use the web browser control (again, I've
even tried a separate web browser control) to load the web page and get the
same result. It seems to me that when the page is loaded with IE, something
additional is happening that does not occur when I am loading with the web
browser controls.

Ideas on what that "something additional" could be are what I'm hoping to
find (or a solution, of course).

I hope that clarifies things.
 
D

David

Tom Shelton said:
I'm not sure what would be causing this issue - but are using the
control to just download data or are you also using it to display the
data? If you simply downloading it, you might want to look at the
System.Net.WebClient class. In fact, even if your displaying the
data, maybe you could use this class to download it to a local file,
and then load that into the webbrowser control?

Just a thought.

I am looking at the elements in the document after downloading it using
MSHTML.Document. I've tried System.Windows.Forms.WebBrowser along with the
ActiveX WebBrowser (I think it was something to do with accessing the MSHTML
document that stopped me from using the former when I wrote the program) but
I'll give System.Net.WebClient a try- perhaps using it to load the "main"
page (see my other response) will fix the problem.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

David said:
The "main" web page is a list of service requests links. My program is
loading the main web page and then loading each individual service request
link. At various points (seems to be random), when attempting to load a
service request page, a runtime error is returned. I've tried slowing the
program down and am convinced the time between downloading each page is not
the cause of the problem.

When the runtime error is returned, I try downloading the same service
request page again after waiting 30 seconds. The runtime error will
continue to be returned.

If I open an instance of IE and load the "main" web page, the runtime error
is not returned and the program continues. IE can be used to load the
"main" web page on the computer running the program or on a different
computer, same results.

What confuses me is why I can not use the web browser control (again, I've
even tried a separate web browser control) to load the web page and get the
same result. It seems to me that when the page is loaded with IE, something
additional is happening that does not occur when I am loading with the web
browser controls.

Ideas on what that "something additional" could be are what I'm hoping to
find (or a solution, of course).

I hope that clarifies things.

There is some potentially vital information missing here. What is the
error message?
 

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