Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Refresh javascript when running
Message
De
17/07/2009 08:02:38
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
17/07/2009 03:34:08
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP SP2
Application:
Web
Divers
Thread ID:
01412716
Message ID:
01412933
Vues:
44
>>Hi Viv,
>>
>>>>Hi all,
>>>>
>>>>I am sure this has been discussed before but if I get an error in my javascript code on a page and I change it then run again the change is not reflected. I get the same error as if I never changed it and it shows code in the error which is commented out. What do I need to do to cause my changes to be refreshed? I have stopped the development server so it has to be restarted and I have rebuilt the project but neither do any good.
>>>
>>>Hi,
>>>IIRC the server won't cache anything unless specifically requested (I assume this is true of the built-in development server as well - wouldn't make much sense if not) so the cacheing is probably on the browser. There are several examples around suggesting ways of preventing this via metadata. Something like:
Response.CacheControl = "no-cache"
>>>Response.AddHeader "Pragma", "no-cache"
>>>Response.Expires = -1
(Untested)
>>>HTH,
>>>Viv
>>
>>I had my head wrapped somehow around the idea that Visual Studio was caching a compiled object or something and not the browser. I am not so concerned at this point about the published application and caching, but really need to be able to code, debug, correct when it comes to javascript stuff. It seemed like a bit of a pain to make changes and not have them be there when you try to debug. I had tried doing a refresh in the browser but with no luck at all. I will try to turn your "Untested" into "Tested" and see what happens. Thanks a bunch.
>
>Hi,
>TBH, if it does work, I wouldn't feel comfortable - that code should probably not be in production so I'd at least wrap it in a #if DEBUG. But Christof's suggestion (which I was not aware of) to handle it in the browser seems a better solution....

Thats too funny Viv. I was only planning on trying it as a "While in development" type of code but you never realize what you forget when you deploy. Reminds me of a time just a few years ago when I was the IT Admin at a city job. We had installed a bunch of new computers and done fresh installs of Corel Office. Most of the users were getting an error message some what random that said "Old Theda Error". After trying to track this down and finally calling Corel it turned out the developer had put that message in there intending to come back to it later and resolve it. Theda was his grandmother. I finally figured it out purely by luck but had to make sure printers were setup and installed BEFORE installing corel.
Tim
Timothy Bryan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform