Posted on: 1/2/2014 11:33:51 AM | Views : 713

I'm using user control caching quite often with the outputcache declaration but I’m trying to disable the cache in some case to give a fresh view to the user.
I’ve tried this :
        PartialCachingControl tc = (PartialCachingControl)LoadControl("~/_UC/myuc.ascx");
        if (mycondition)
        {
            tc.CachePolicy.Cached = false;
            tc.CachePolicy.Duration = new TimeSpan(0);
        }
        myplaceholder.Controls.Add(tc); ...

Go to the complete details ...