Solved

Navigating with Webbrowser controll w/o using cache

Posted on 2002-04-09
14
1,223 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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
 
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA open file from excel cell 4 42
Reading the Contents of a Directory In Access VBA 5 69
passing a value with stream reader AFTER a ";" 3 67
using web browser with BING 40 121
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

773 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