Webbrowser.navigate() not firing

  • Thread starter Thread starter Ryan Ramsey
  • Start date Start date
R

Ryan Ramsey

I have been chasing this one down for a week and have narrowed it down to a
machine issue.

I have the following code:
webBrowser.Navigate(http://finao.net/post_dkp.php?database=40);

Basically all this script does is create an xml output file.

After the navigate, the function stops and is triggered again when
webbrowser_DocumentCompleted fires and then the XML file is read by the
program

Here is the odd thing... DocumentCompleted ALWAYS fires (as if the navigate
fires).

On machine one, everything works fine, the post_dkp.php script is run, and a
new xml file is created. I know this because in the XML file i embedded a
timestamp so i know the data is fresh.

On machine two, the navigate fires because DocumentCompleted fires, but the
script hasn't executed because the XML file contains stale information.

My question: How do I debug this as webBrowser.Navigate does not return any
detailed status's.

The client seems to think the script is being executed but obviously it is
not.

Im thinking the 2nd machine might have a firewall issue preventing the
navigate but when DocumentCompleted fires a Dataset.ReadXML() ALWAYS works
(the xml file is read 100% of the time despite being stale or not). This
leads me think it might NOT be a firewall issue.

To confuse things even more... Sometimes it works on machine two, but 90% of
the time I get the stale info.

Please help. I am unfamiliar with all the little tools in the suite to debug
this kind of stuff but I would really appreciate some help or some guidance
to how to do this better.

Ryan
 
A few people asked me if i solved this.. Im surprised MS didn't catch this.

Basically Webbrowser.Navigate(url) ONLY fires if the url changes. If it
doesn't change it uses a cached version of the web page.

This is odd because it doesn't seem to check the web page for changes.

I got around this by comparing Webbrowser.url to 'url'.. If it was different
I would call the navigate. If it was the same, i would call
webBrowser.Refresh(WebBrowserRefreshOption.Completely);

The other troublesome thing is the Refresh does not trigger
DocumentCompleted which I think is lame.

Recommedations to MS:
- Create an option in Webbrowser.Navigate to FORCE web page executes
despite the url (ie.
Webbrowser.Navigate(urll,WebBrowserRefreshOption.Completly)
- Allow Webbrowser.Refresh() to trigger the DocumentCompleted event.
 
Back
Top