views:

188

answers:

1

How is it possible to create various cached versions of a user control based on a field within the control. So for example I have a user control that has the following declaration:

int someInt = 0;

Let's say this variable could be set to any value between 1 and 10. If I want a separate cached user control for each value of the variable - how do I achieve this?

A: 

What you need is VaryByControl. See

http://stackoverflow.com/questions/880937/vary-by-control-properties-using-partialcaching-in-asp-net

for details.

Andreas Paulsson