This is a migrated thread and some comments may be shown as answers.

RadScriptManager loads staled script when using ScriptReference

2 Answers 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vlad
Top achievements
Rank 1
Vlad asked on 08 Sep 2011, 06:50 PM
I run into problem when using ScriptReference,
there was a bug in my extrenal  js code contained in .js file
which I load using RadScriptManager /ScriptReference. I corrected the bug
but VS debugger kept breaking on the same line even after I completely removed
everything it still would break on empty line with original error message about
null variable which no longer even in the code. I restarted VS, then Workstation
but it kept breaking on the same empty line. So then I renamed the js file
and VS loaded the old file with original bug, The file tab says "dynamic" and I have no idea
where VS 2010 pulls that from. Is is VS problem or RadScriptManager  using cached js files ?

I have not done much javascript coding in VS 2010 but in VS 2008 I did several
javascript projects(no telerik, just vanilla js) with some heavy coding and never run into problem like this.

2 Answers, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 12 Sep 2011, 12:18 PM
Hi Vlad,

It seems that the browser, which you are using, has cached the files. If you take a look at the links generated by RadScriptManager, you will notice that there is a timestamp token in the URL, which serves for caching purposes. If the file shipped is modified, the token will be changed and the browser will request the new file. I am not sure why this is not happening on your machine, perhaps the VisualStudio integrated web-server does provide information whether a file has changed or not, therefore RadScriptManager can't modify the tamps stamp accordingly. IIS supports this for sure. I suggest that you disable caching for JS files for dev environment and leave the cache only for production, where there are no changes to the hosted files. You can disable cache using the following RadScriptManager configuration:

<telerik:RadScriptManager runat="server" ID="ScriptManager1">
      <CacheSettings Enabled="false" />
   </telerik:RadScriptManager>



Kind regards,
Genady Sergeev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Allen
Top achievements
Rank 2
Iron
Veteran
answered on 15 Nov 2015, 05:19 AM

I just had the same issue.  What I did was stop the local IIS Express web server and let it restart when I reran the application from the development environment, FWIW...

 Cheers.

 

Tags
General Discussions
Asked by
Vlad
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Allen
Top achievements
Rank 2
Iron
Veteran
Share this question
or