0

Hope someone can help me on this. I manage an ASP.Net website and usually update script files and css files very often. I add current time appended into a single string as a query string parameter (eg: profileImage.jpg?123021) which makes the browser to look for the file without getting it from cache.

How can I do the same thing to all script tags and css links from the server side so that it loads the latest version of the file.

Any help appreciated.

Amila

1 Answer 1

0

If your asp.net website uses Master Pages, it should be easy to make these changes in the Master Page file. Look a file with the extension .master. If you are not sure how to make the specific edit, post the <head> area from the master page markup in a new question.

MSDN Master Pages: http://msdn.microsoft.com/en-us/library/wtxbf3hh(v=vs.100).aspx

If your site does not use master pages, then you'd need to create some server-side logic that affects the <head> section of the page. Below are some links to related QA's about injecting script and styles from the server side.

ASP.NET: How to (programmatically) attach a <script> tag, containing a link to .js, to <head>?

How to Add script codes before the </body> tag ASP.NET

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.