H
helveticus
I have a master/details configuration that includes multiple user
controls. The details page is configured to cache data via
VaryByCustom. This works fine.
One of the user controls contains an image button. With caching turned
on, the control remains "lame" since the control is only dynamically
generated during the first access.
My understanding is that page caching directive causes all page user
controls to be implicitly cached as well. To prevent user control
caching, I tried adding the following code inside the user control
load event. But this clears the whole page cache:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
If Not Page.IsPostBack Then
Response.Cache.SetCacheability(HttpCacheability.NoCache)
End If
End Sub
Is is possible to exclude a specific user control from being cached
when the page is cached? Are there other alternatives? TIA for any
hints.
controls. The details page is configured to cache data via
VaryByCustom. This works fine.
One of the user controls contains an image button. With caching turned
on, the control remains "lame" since the control is only dynamically
generated during the first access.
My understanding is that page caching directive causes all page user
controls to be implicitly cached as well. To prevent user control
caching, I tried adding the following code inside the user control
load event. But this clears the whole page cache:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs)
If Not Page.IsPostBack Then
Response.Cache.SetCacheability(HttpCacheability.NoCache)
End If
End Sub
Is is possible to exclude a specific user control from being cached
when the page is cached? Are there other alternatives? TIA for any
hints.