S
Stewart
Hi all, hoping one of you may be able to throw up an idea on the
following. I have an asp.net page with a drop-down and a user control
inside. The user control should be cached in one way or another as it
takes a lot of database work to produce.
-----------------------------------------
| |
| DROP DOWN V |
| |
| ------------------ |
| | | |
| | USER CONTROL | |
| | | |
| ------------------ |
| |
| |
| |
-----------------------------------------
Now the problem I am having is that the contents of the drop down
changes from time to time. This prevents us from caching the whole
page for any significant amount of time. The data accessed by the
user control is different depending on the setting of the drop down.
My question is how do I cache the user control output (with a
different version for each drop-down value)?
I've tried:
1) Using VaryByParam, but the default page has no param and hence if
the default selected item in the drop down changes, the user control's
cached output does not.
2) Tried VaryByControl. For this to work the control in question (ie
the dropdown) actually needs to be part of the user control. If we
made it so then we could not update the contents of the dropdown (as
it is cached).
Ideas?
Thanks,
Stewart
following. I have an asp.net page with a drop-down and a user control
inside. The user control should be cached in one way or another as it
takes a lot of database work to produce.
-----------------------------------------
| |
| DROP DOWN V |
| |
| ------------------ |
| | | |
| | USER CONTROL | |
| | | |
| ------------------ |
| |
| |
| |
-----------------------------------------
Now the problem I am having is that the contents of the drop down
changes from time to time. This prevents us from caching the whole
page for any significant amount of time. The data accessed by the
user control is different depending on the setting of the drop down.
My question is how do I cache the user control output (with a
different version for each drop-down value)?
I've tried:
1) Using VaryByParam, but the default page has no param and hence if
the default selected item in the drop down changes, the user control's
cached output does not.
2) Tried VaryByControl. For this to work the control in question (ie
the dropdown) actually needs to be part of the user control. If we
made it so then we could not update the contents of the dropdown (as
it is cached).
Ideas?
Thanks,
Stewart