Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1261
  • Last Modified:

Navigating with Webbrowser controll w/o using cache

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
Benjy
Asked:
Benjy
  • 6
  • 4
  • 4
1 Solution
 
rkot2000Commented:
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
 
BenjyAuthor Commented:
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
 
rkot2000Commented:
if you have access to the page,
you can disable caching from the page.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
BenjyAuthor Commented:
what do you mean?
0
 
rkot2000Commented:
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
 
BenjyAuthor Commented:
In that case, no I don't have access to the pages. I am reading information from third party websites.
0
 
Richie_SimonettiCommented:
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
 
Richie_SimonettiCommented:
Just a question: How do you know that page viewed is from cache and not from web site?
0
 
BenjyAuthor Commented:
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
 
rkot2000Commented:
try to declare with withevents statement.
0
 
BenjyAuthor Commented:
Already tried and works. Thanks.
0
 
Richie_SimonettiCommented:
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
 
Richie_SimonettiCommented:
So, if you delete the cache, nor IE neither Webbrowser control couldn't find any entry.
0
 
BenjyAuthor Commented:
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 6
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now