views:

479

answers:

2

I would like to be able to have a version number appended to a css file located in my app_themes folder in my asp.net website so that modification to the file would force the browser to get the file from the server instead of using the one in the cache.

the css output path would look like ~/app_themes/blue/blue.css?v=1234

Any idea how it can be done without having to manually edit the filename?

+6  A: 

I'd try something like this

<link 
  rel="stylesheet" 
  href="/app_themes/blue/blue.css?v=<%=Global.VERSION_NUM%>">

Do that to all your CSS references, then when you make a deployment to your live site, you can just change the constant VERSION_NUM

Clyde
A: 

A more detailed solution is available here:
http://stackoverflow.com/questions/2019807/add-url-parameter-to-css-file-in-asp-themes-folder

Nariman