Reputation: 74
I want to clear the Cache of a WebBrowser
control dynamically in Windows Phone 7.1 using C#. Previously selected images are loading again in my WebBrowser
, has anyone ran into this before?
Upvotes: 0
Views: 2111
Reputation: 716
For clearing images this code can be helpfull to you.
BitmapImage bitmapImage = image.Source as BitmapImage;
bitmapImage.UriSource = null;
image.Source = null;
This works. happy coding
Upvotes: 0
Reputation: 926
Clearing Cache in WP7.1 is not possible.
The workaround can be to force the browser to load fresh page each time. This can be accomplished in many ways such as:
- Using False Query i.e. Passing a random parameter in location of web page like /page.html?q=5
- Using tags based methods to prevent caching (google it)
- passing no-cache headers from server itself
Upvotes: 3
Reputation: 9604
On Windows Phone 8 you can use the extension method ClearInternetCacheAsync.
This won't work on WP7.1 however. See another StackOverflow question that deals with that.
Upvotes: 2