E
Edward Chung
I create a user control that is used as a page header for all
application's pages. The user control contains a HyperLink control named
accountHyperlink whose text can either set to "Account/Logon" or
"Account/Logout" depending on whether the user is logged on. I want to cache
this user control for 1 hour but have it automatically reloaded if the
accountHyperlink.Text is changed. So I place the following line of code on
its ascx page:
<% @OutputCache%@ OutputCache Duration="3600" VaryByParam="none"
VaryByControl="accountHyperlink" %>
The user control is not refreshed on other pages that use it after the
accountHyperlink.Text changed. So do I use incorrect codes for my purpose or
do I need to place more codes (somewhere) to force the user control to
reload to reflect the change?
application's pages. The user control contains a HyperLink control named
accountHyperlink whose text can either set to "Account/Logon" or
"Account/Logout" depending on whether the user is logged on. I want to cache
this user control for 1 hour but have it automatically reloaded if the
accountHyperlink.Text is changed. So I place the following line of code on
its ascx page:
<% @OutputCache%@ OutputCache Duration="3600" VaryByParam="none"
VaryByControl="accountHyperlink" %>
The user control is not refreshed on other pages that use it after the
accountHyperlink.Text changed. So do I use incorrect codes for my purpose or
do I need to place more codes (somewhere) to force the user control to
reload to reflect the change?