Can the @Scripts.Render command add a version?

14 views Asked by At

To prevent browsers from caching javascript files, I render them like so:

@Scripts.Render("~/Scripts/app/Forecast.js?ver=" + DateTime.Now.Ticks.ToString())

Adding ?ver=9999 to the URL causes the script file to be loaded by every page request (though not by Firefox, I think).

Anyway, can I also add a version if I bundle the scripts using @Scripts.Render("~/bundles/MyBundle") ? If so, how?

0

There are 0 answers