How to set up the properties of cached controls dynamically

This article advices how you could set up properties of Kentico controls in code behind dynamically in the case they cache the content (CacheMinutes>0).
Please use sample code bellow in code-behind:
your_control.StopProcessing = false;

//here comes your code changing the control properties e.g.:
// your_control.Path = “/%“;
Please switch to Design mode and set the StopProcessing property of the control to true. For example:
<cc1:CMSRepeater ID="your_control" runat="server" transformationName="your_transformation" CacheMinutes="10" StopProcessing="true">
Now, it should work correctly even if you use content caching.

Applies to: Kentico CMS 4.0
Share this article on   LinkedIn