I have a user control in my asp.net application that load it's data from cache. i want it's cache be updated when the value of a variable be changed so i put this code on page directive
<%@ OutputCache Duration="1000" VaryByParam="none"
VaryByControl="visitIsAu" %>
it works fine when i change the value of variable in markup like this
visitIsAu="true"
but it doesn't work when the value is changed through code behind like this
visitIsAu="<%=this.CurentUser.IsAuthorizedToVisitFiltered%>"
the value of variable does not change so its cache is not updated.
does anyone know why this happen?