I have just spent half a day quietly going mad.
I’m making changes to my classes in the Site.css file and they were not being reflected in the site being developed on my machine. Because I’m learning my way through jQuery and playing with addClass and removeClass and I’m creating the parameters for those calls dynamically, I was sure the problem was in my implementation.
Turns out the CSS file was cached in the browser and all I had to do was refresh it…
Is there a way to force a refresh (preferably only during debug I guess)?
A popular way of “cache-breaking” is to append a parameter to your css source. Typically a timestamp is used. I prefer the “file last modified” time, ie.
filemtime()in PHP. I’m sure there’s an asp.net function that would give you that.Then your CSS tag becomes:
with the query parameter changing whenever the CSS file is updated.