How can I output the CDF version inside a C# Razor template in 2sxc?

Viewed 45

I have a template that has an image tag inside of it. I want to append the DNN CDF version to the image. So for example, when I increment the CDF version and skin.css?cdv=74, then the image tag inside of my 2sxc razor templates will also get pushed to src="@Content.Image?cdv=74" so any updates to the image don't get stuck with browser caching. Is this possible and how would I do it?

2 Answers

In short, you can get it using the servicesFramework via the following:

serviceFramework.get("ServerSettingsPerformance", "GetPerformanceSettings")

Here is an example of how it is done within DNN.

Related