With this partial view you are able to include CSS, JavaScript and image resources in your code, that'll automatically get versioned. Every time you save the file on the server, it will get a new version parameter on the query string causing your browsers to redownload the resource.

As you see in the partial it's possible to add strings for alt-, width- and height-attributes when using the partial for images, for this I'm using the possibility for adding a ViewDataDictionary as a parameter in the call to Html.Partial. The ViewDataDictionary is a key/value dictionary made available in your Razor script as @ViewData, and it is easily declared when using the Partial view with the Html-helper in a view. The Partial can be used in these ways:

Bonusinfo

It's now possible to control the caching of your static resources, and you can put this is in your Umbraco project just by creating a partial view using the excellent Umbraco backend.

But you might like to know how you can set up a really, really long caching period for your static ressources since you're now able to force the client-browsers to download the newer version every time you update the file.

This cannot be done from the Umbraco backend, so you might have to ask the webserver administrator to set it for your IIS website, or if you have access to your website filesystem via FTP or RDP or something else, you could just put the following XML-snippet in place:

In an ordinary Umbraco website, the <staticContent> node will already be in place, so you should just add the clientCache node to the existing node.

This setting will cache all your static content in the client browsers for 365 days. If you're trying to do cache busting while developing your site in Visual Studio, or just want to do this using a proper HtmlHelper function, you can read my take on cache busting with the HtmlHelper.

That's it

Have a nice holiday season, and while you're away from your computer why not Bust a Move instead.