1

I have a C# application with a webpage displaying a website. Upon recently overhauling the website (fairly simple website, not much on it) the application continues to use the old background and does not use the CSS of the new document. I suspect some form of caching is causing this problem, can anyone help me with it? (The website works fine in browser, but not in the application)

  • 2
    Set an unique link to your css, like styles.css?asdfdsgfjijwelrmsdnfjdsflks – VMAtm Apr 08 '15 at 23:15
  • What control are you using in the C# app to display the application? The standard forms control leverages IE and so it's probably cached by IE. – AaronLS Apr 08 '15 at 23:16
  • What do you mean by this VMAtm? I have a separate CSS file which is linked to in the html. – Bilbo Baggins Apr 08 '15 at 23:17
  • AaronLS, How would I go about changing this? – Bilbo Baggins Apr 08 '15 at 23:18
  • @BilboBaggins You can force the browser to retrieve a new CSS by generating the HTML page with a different query string param to the end where the page links (` – AaronLS Apr 08 '15 at 23:24
  • I would go with @VMAtm answer but with a date time as the query parameter so Ross doesn't happen in the future. :-) – Kurtis Apr 08 '15 at 23:43

1 Answers1

1

You need to clear the cache of the webbrowser instance programatically:

webBrowser.Refresh(WebBrowserRefreshOption.Completely)
Alex
  • 21,273
  • 10
  • 61
  • 73