Reputation: 2271
In my user controls, I am inheriting from IScriptControl and then referencing a .js file. Currently when I do an update in the .js file, I ask users to clear their browser cache. Is there a way to solve this issue. How can the browser know that a new version has to be downlaoded from the server?
Upvotes: 1
Views: 114
Reputation: 199
You should store the JS file inside a DLL as a WebResource and reference to it in ScriptDescriptor. This way ScriptManager generated javascript reference that contains DLL hash in it's URL, thus when you modify your code and recompile - the DLL's hash is changed, forcing the browser to reload JS file (since the framework generates different URL which is based on the DLL's hash).
Upvotes: 2