RadScriptManager loads staled script when using ScriptReference

3 posts, 1 answers
  1. Vlad
    Vlad avatar
    11 posts
    Member since:
    Aug 2011

    Posted 08 Sep 2011 Link to this post

    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. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 12 Sep 2011 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Allen
    Allen avatar
    50 posts
    Member since:
    Mar 2011

    Posted 14 Nov 2015 in reply to Genady Sergeev Link to this post

    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.

     

Back to Top