PC Review


Reply
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average.

AxWebBrowser problem!

 
 
Martin Ho
Guest
Posts: n/a
 
      1st Mar 2005
Hey Everyone,

I really hope there is someone who can figure out this problem.
Honestly, I spent 3 days now trying to find the solution, but nothing
works.

I'll try to explain the problem shortly, so I don't take too much of
your time.

Problem:
On the form I have AxWebBrowser box, and I load the page in it,
normally you would do it like this:

Dim finalurl as string = "http://www.mysite.com/example.php"
AxWebBrowser1.Navigate2(finalurl)

I set up a timer1 tick to go off every 10 minutes.
Example.php I am trying to load is a php script which comes up to have
different variables everytime you reload/refresh it.

In my case everytime I call the page, variables are the same. It never
refreshes it.

So I did my research and there was a suggestion to do this:

AxWebBrowser1.Refresh2(finalurl)
AxWebBrowser1.Navigate2(finalurl)


So I did another research and there was a suggestion to do this:

Dim finalurl as string = "http://www.mysite.com/example.php"
Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
AxWebBrowser1.Navigate2(finalurl)

Well, this didn't work either.
So after another day of browsing Google, I found that someone
suggested to do this:

Private Enum BrowserNavConstants As Integer
navOpenInNewWindow = &H1
navNoHistory = &H2
navNoReadFromCache = &H4
navNoWriteToCache = &H8
navAllowAutosearch = &H10
navBrowserBar = &H20
navHyperlink = &H40
End Enum

and then call AxWebBrowser like this, so it is using property called:
navNoReadFromCache

AxWebBrowser1.Navigate2(finalurl,
BrowserNavConstants.navNoReadFromCache, Nothing, Nothing, Nothing)


Well, this doesn't work either and my application is not refreshing
the values, which I need to bring into the program.

Guys, I am really lost and I've got to the point of resignation. I
simly can't get it to work and no one can figure out how to do this.

Someone suggested to delete cookies and temporary cache files which
this php page is creating.
But that is not easy, location differs from pc to pc, and from
platform to platform and Ireally believe, that there should be some
other way of doing it.

Now, one valid point and that might be a help.
While application is running and refreshing values every 10 minutes,
NOTHING CHANGES, variables are still the same.
But if I open my Internet Explorer and go to the page (example.php),
it shows me updated values.
And my program as if someone used a magic stick, refreshes too.

So, what should I do? Is there any, and I mean any way, to refresh,
reload AxWebBrowser?
Any way to make it, so it doesn't read the page from cache?

Please, your help will be greatly appreciated.

Martin Ho.


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
 
Reply With Quote
 
 
 
 
D0tN3t C0d3r
Guest
Posts: n/a
 
      1st Mar 2005
Hi Martin,

The AxWebBrowser uses the same cache settings as IE does. Why it's
always reading from cache, I can't answer, but I can suggest an
alternative that does not rely on the AxWebBrowser. (It is worth noting
that the AxWebBrowser is buggy, always has been, always will be. One of
the reasons why the System.Net namespace has the
WebClient/WebResponse/WebClient classes).

If you insist on using the browser control, then what I would make sure
of is that your php page is set to expire immediately. Also, you should
set a pragma-no-cache meta tag to be on the safe side.

If you don't need the browser functionality (you had mentioned that you
were reading variables from the php page), I would recommend web page
scraping using the System.Net namespace. (I can't give code samples as I
am not a VB programmer):

http://www.codersource.net/csharp_screen_scraping.html
http://aspalliance.com/cookbook/View...spx?Chapter=21

Using this method, you are never going to cache and you don't have to
deal with ugly ActiveX controls.

HTH,
~d

Martin Ho wrote:
> Hey Everyone,
>
> I really hope there is someone who can figure out this problem.
> Honestly, I spent 3 days now trying to find the solution, but nothing
> works.
>
> I'll try to explain the problem shortly, so I don't take too much of
> your time.
>
> Problem:
> On the form I have AxWebBrowser box, and I load the page in it,
> normally you would do it like this:
>
> Dim finalurl as string = "http://www.mysite.com/example.php"
> AxWebBrowser1.Navigate2(finalurl)
>
> I set up a timer1 tick to go off every 10 minutes.
> Example.php I am trying to load is a php script which comes up to have
> different variables everytime you reload/refresh it.
>
> In my case everytime I call the page, variables are the same. It never
> refreshes it.
>
> So I did my research and there was a suggestion to do this:
>
> AxWebBrowser1.Refresh2(finalurl)
> AxWebBrowser1.Navigate2(finalurl)
>
>
> So I did another research and there was a suggestion to do this:
>
> Dim finalurl as string = "http://www.mysite.com/example.php"
> Dim REFRESH_COMPLETELY As Object = 3
> AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
> AxWebBrowser1.Navigate2(finalurl)
>
> Well, this didn't work either.
> So after another day of browsing Google, I found that someone
> suggested to do this:
>
> Private Enum BrowserNavConstants As Integer
> navOpenInNewWindow = &H1
> navNoHistory = &H2
> navNoReadFromCache = &H4
> navNoWriteToCache = &H8
> navAllowAutosearch = &H10
> navBrowserBar = &H20
> navHyperlink = &H40
> End Enum
>
> and then call AxWebBrowser like this, so it is using property called:
> navNoReadFromCache
>
> AxWebBrowser1.Navigate2(finalurl,
> BrowserNavConstants.navNoReadFromCache, Nothing, Nothing, Nothing)
>
>
> Well, this doesn't work either and my application is not refreshing
> the values, which I need to bring into the program.
>
> Guys, I am really lost and I've got to the point of resignation. I
> simly can't get it to work and no one can figure out how to do this.
>
> Someone suggested to delete cookies and temporary cache files which
> this php page is creating.
> But that is not easy, location differs from pc to pc, and from
> platform to platform and Ireally believe, that there should be some
> other way of doing it.
>
> Now, one valid point and that might be a help.
> While application is running and refreshing values every 10 minutes,
> NOTHING CHANGES, variables are still the same.
> But if I open my Internet Explorer and go to the page (example.php),
> it shows me updated values.
> And my program as if someone used a magic stick, refreshes too.
>
> So, what should I do? Is there any, and I mean any way, to refresh,
> reload AxWebBrowser?
> Any way to make it, so it doesn't read the page from cache?
>
> Please, your help will be greatly appreciated.
>
> Martin Ho.
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com

 
Reply With Quote
 
martin.lanny@gmail.com
Guest
Posts: n/a
 
      1st Mar 2005

D0tN3t C0d3r wrote:
> Hi Martin,
>
> The AxWebBrowser uses the same cache settings as IE does. Why it's
> always reading from cache, I can't answer, but I can suggest an
> alternative that does not rely on the AxWebBrowser. (It is worth

noting
> that the AxWebBrowser is buggy, always has been, always will be. One

of
> the reasons why the System.Net namespace has the
> WebClient/WebResponse/WebClient classes).
>
> If you insist on using the browser control, then what I would make

sure
> of is that your php page is set to expire immediately. Also, you

should
> set a pragma-no-cache meta tag to be on the safe side.
>
> If you don't need the browser functionality (you had mentioned that

you
> were reading variables from the php page), I would recommend web page


> scraping using the System.Net namespace. (I can't give code samples

as I
> am not a VB programmer):
>
> http://www.codersource.net/csharp_screen_scraping.html
> http://aspalliance.com/cookbook/View...spx?Chapter=21
>
> Using this method, you are never going to cache and you don't have to


> deal with ugly ActiveX controls.
>
> HTH,
> ~d
>
> Martin Ho wrote:
> > Hey Everyone,
> >
> > I really hope there is someone who can figure out this problem.
> > Honestly, I spent 3 days now trying to find the solution, but

nothing
> > works.
> >
> > I'll try to explain the problem shortly, so I don't take too much

of
> > your time.
> >
> > Problem:
> > On the form I have AxWebBrowser box, and I load the page in it,
> > normally you would do it like this:
> >
> > Dim finalurl as string = "http://www.mysite.com/example.php"
> > AxWebBrowser1.Navigate2(finalurl)
> >
> > I set up a timer1 tick to go off every 10 minutes.
> > Example.php I am trying to load is a php script which comes up to

have
> > different variables everytime you reload/refresh it.
> >
> > In my case everytime I call the page, variables are the same. It

never
> > refreshes it.
> >
> > So I did my research and there was a suggestion to do this:
> >
> > AxWebBrowser1.Refresh2(finalurl)
> > AxWebBrowser1.Navigate2(finalurl)
> >
> >
> > So I did another research and there was a suggestion to do this:
> >
> > Dim finalurl as string = "http://www.mysite.com/example.php"
> > Dim REFRESH_COMPLETELY As Object = 3
> > AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
> > AxWebBrowser1.Navigate2(finalurl)
> >
> > Well, this didn't work either.
> > So after another day of browsing Google, I found that someone
> > suggested to do this:
> >
> > Private Enum BrowserNavConstants As Integer
> > navOpenInNewWindow = &H1
> > navNoHistory = &H2
> > navNoReadFromCache = &H4
> > navNoWriteToCache = &H8
> > navAllowAutosearch = &H10
> > navBrowserBar = &H20
> > navHyperlink = &H40
> > End Enum
> >
> > and then call AxWebBrowser like this, so it is using property

called:
> > navNoReadFromCache
> >
> > AxWebBrowser1.Navigate2(finalurl,
> > BrowserNavConstants.navNoReadFromCache, Nothing, Nothing, Nothing)
> >
> >
> > Well, this doesn't work either and my application is not refreshing
> > the values, which I need to bring into the program.
> >
> > Guys, I am really lost and I've got to the point of resignation. I
> > simly can't get it to work and no one can figure out how to do

this.
> >
> > Someone suggested to delete cookies and temporary cache files which
> > this php page is creating.
> > But that is not easy, location differs from pc to pc, and from
> > platform to platform and Ireally believe, that there should be some
> > other way of doing it.
> >
> > Now, one valid point and that might be a help.
> > While application is running and refreshing values every 10

minutes,
> > NOTHING CHANGES, variables are still the same.
> > But if I open my Internet Explorer and go to the page

(example.php),
> > it shows me updated values.
> > And my program as if someone used a magic stick, refreshes too.
> >
> > So, what should I do? Is there any, and I mean any way, to refresh,
> > reload AxWebBrowser?
> > Any way to make it, so it doesn't read the page from cache?
> >
> > Please, your help will be greatly appreciated.
> >
> > Martin Ho.
> >
> >
> > Posted Via Usenet.com Premium Usenet Newsgroup Services
> > ----------------------------------------------------------
> > ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> > ----------------------------------------------------------
> > http://www.usenet.com


 
Reply With Quote
 
martin.lanny@gmail.com
Guest
Posts: n/a
 
      2nd Mar 2005
Can anyone help, please?

 
Reply With Quote
 
Mike Potter
Guest
Posts: n/a
 
      5th Mar 2005
I've ran into this thread as I was having the same issue.

My solution was to prevent the page itself fom being cached:

response.buffer = true
response.cacheControl = "no-cache"
response.addHeader "Pragma", "no-cache"
response.expires = -1



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
New Member
Join Date: Apr 2008
Posts: 1
 
      3rd Apr 2008
I had the same problems; I resolved now with:
WB.navigate complete_url, navNoWriteToCache
Try and tell me after.



Quote:
Originally Posted by Martin Ho
Hey Everyone,

I really hope there is someone who can figure out this problem.
Honestly, I spent 3 days now trying to find the solution, but nothing
works.

I'll try to explain the problem shortly, so I don't take too much of
your time.

Problem:
On the form I have AxWebBrowser box, and I load the page in it,
normally you would do it like this:

Dim finalurl as string = "http://www.mysite.com/example.php"
AxWebBrowser1.Navigate2(finalurl)

I set up a timer1 tick to go off every 10 minutes.
Example.php I am trying to load is a php script which comes up to have
different variables everytime you reload/refresh it.

In my case everytime I call the page, variables are the same. It never
refreshes it.

So I did my research and there was a suggestion to do this:

AxWebBrowser1.Refresh2(finalurl)
AxWebBrowser1.Navigate2(finalurl)


So I did another research and there was a suggestion to do this:

Dim finalurl as string = "http://www.mysite.com/example.php"
Dim REFRESH_COMPLETELY As Object = 3
AxWebBrowser1.Refresh2(REFRESH_COMPLETELY)
AxWebBrowser1.Navigate2(finalurl)

Well, this didn't work either.
So after another day of browsing Google, I found that someone
suggested to do this:

Private Enum BrowserNavConstants As Integer
navOpenInNewWindow = &H1
navNoHistory = &H2
navNoReadFromCache = &H4
navNoWriteToCache = &H8
navAllowAutosearch = &H10
navBrowserBar = &H20
navHyperlink = &H40
End Enum

and then call AxWebBrowser like this, so it is using property called:
navNoReadFromCache

AxWebBrowser1.Navigate2(finalurl,
BrowserNavConstants.navNoReadFromCache, Nothing, Nothing, Nothing)


Well, this doesn't work either and my application is not refreshing
the values, which I need to bring into the program.

Guys, I am really lost and I've got to the point of resignation. I
simly can't get it to work and no one can figure out how to do this.

Someone suggested to delete cookies and temporary cache files which
this php page is creating.
But that is not easy, location differs from pc to pc, and from
platform to platform and Ireally believe, that there should be some
other way of doing it.

Now, one valid point and that might be a help.
While application is running and refreshing values every 10 minutes,
NOTHING CHANGES, variables are still the same.
But if I open my Internet Explorer and go to the page (example.php),
it shows me updated values.
And my program as if someone used a magic stick, refreshes too.

So, what should I do? Is there any, and I mean any way, to refresh,
reload AxWebBrowser?
Any way to make it, so it doesn't read the page from cache?

Please, your help will be greatly appreciated.

Martin Ho.


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AxSHDocVw.AxWebBrowser problem :( =?iso-8859-1?Q?Vicente_Garc=EDa?= Microsoft C# .NET 2 7th Nov 2006 10:53 AM
problem with navigating axWebBrowser. Dibs Microsoft VB .NET 1 12th Oct 2004 11:42 AM
AxWebBrowser control problem Chuck Bowling Microsoft C# .NET 3 20th Jul 2004 06:42 PM
Problem with AxWebBrowser on an MDI Child Scott Microsoft VB .NET 0 14th Sep 2003 02:25 PM
Print Problem using AXWebBrowser AH Microsoft C# .NET 0 24th Jul 2003 08:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:57 AM.