Solved

Navigating with Webbrowser controll w/o using cache

Posted on 2002-04-09
14
1,214 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

760 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

20 Experts available now in Live!

Get 1:1 Help Now