Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refresh javascript when running
Message
From
17/07/2009 03:34:08
 
 
To
16/07/2009 16:19:03
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
ASP.NET
OS:
Windows XP SP2
Application:
Web
Miscellaneous
Thread ID:
01412716
Message ID:
01412911
Views:
32
>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....
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform