Solved

Navigating with Webbrowser controll w/o using cache

Posted on 2002-04-09
14
1,218 Views
Last Modified: 2011-10-03
Hi,
I am using the webbrowser controll and I navigate to a few certain pages over and over again, my problem is, as of the second time I navigate to each page I am getting an ofline version (from cache)and not the up to date page.
How do I navigate ignoring previous cached pages?
Thanks in advance,
Benjy.
0
Comment
Question by:Benjy
  • 6
  • 4
  • 4
14 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6928450
I think you need to use this flag navNoHistory :
webcontrl.navigate url, myflag


Contains values used by the IWebBrowser2::Navigate and IWebBrowser2::Navigate2 methods.

Syntax

typedef enum BrowserNavConstants {
    navOpenInNewWindow = 0x1,
    navNoHistory = 0x2,
    navNoReadFromCache = 0x4,
    navNoWriteToCache = 0x8,
    navAllowAutosearch = 0x10,
    navBrowserBar = 0x20,
    navHyperlink = 0x40
} BrowserNavConstants;

Constants

navOpenInNewWindow
Open the resource or file in a new window.

navNoHistory
Do not add the resource or file to the history list. The new page replaces the current page in the list.

navNoReadFromCache
Not currently supported.

navNoWriteToCache
Not currently supported.

navAllowAutosearch
If the navigation fails, the autosearch functionality attempts to navigate common root domains (.com, .edu, and so on). If this also fails, the URL is passed to a search engine.

navBrowserBar
Causes the current Explorer Bar to navigate to the given item, if possible.

navHyperlink
If the navigation fails when a hyperlink is being followed, this constant specifies that the resource should then be bound to the moniker using the BINDF_HYPERLINK flag.

0
 
LVL 1

Author Comment

by:Benjy
ID: 6928539
No, That didn't do it.
It would make sence that the navNoReadFromCache is in place, but it is not supported. (I tried it and it indeed doesn't work)

Any suggestions?
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6928549
if you have access to the page,
you can disable caching from the page.
0
 
LVL 1

Author Comment

by:Benjy
ID: 6928572
what do you mean?
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6928598
in the asp page
or in the iis server you can set
expiration date or just disable page caching

<%@ Language=VBScript %>
<%
          Option Explicit  
          Response.Buffer = True
                'do not cache this page on the client
          Response.CacheControl = "no-cache"
          Response.AddHeader "Pragma", "no-cache"
          Response.Expires = -1
%>
0
 
LVL 1

Author Comment

by:Benjy
ID: 6928691
In that case, no I don't have access to the pages. I am reading information from third party websites.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6928925
If it is allow, you could delte cache entries before navigate again to same site:
http://www.mvps.org/vbnet/code/internet/deleteurlcache.htm
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6928927
Just a question: How do you know that page viewed is from cache and not from web site?
0
 
LVL 1

Author Comment

by:Benjy
ID: 6953578
I thought of using Internet Explorer instead of webbrowser, but I only know how to use it by declaring it (dim ie as new internetexplorer) and not by placing an object of it on the form.
1. is there a way to place it on the form?
2. even better, how can I use it's events w/o having an object on the form (afternavigate, downloadcomplete etc.)?
0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 100 total points
ID: 6953604
try to declare with withevents statement.
0
 
LVL 1

Author Comment

by:Benjy
ID: 6953823
Already tried and works. Thanks.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6953833
krot is right.
You need to add in declarations section of form

dim withevents IE as internetexplorer

form_load
set IE = new internetexplorer
with IE
     .navigate "www.experts-exchange.com"
     .visible = true
end with
end sub

IE and webbrowser use the same Internet configurations (Example: if you set in advanced tab of internet explorer
 configuration "No display images", webbrowser will not display images also)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6953840
So, if you delete the cache, nor IE neither Webbrowser control couldn't find any entry.
0
 
LVL 1

Author Comment

by:Benjy
ID: 6954081
Richie,
Thanks but I don't think it is appropiate to delete a users cache without asking him.
Thanks again for your effort.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 start screen issues 9 51
Saving history changes to sub form 4 35
VBA Shell can't Find Word document 11 73
how to know if my Checkbox is True in VB6.0? 9 36
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now