Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to set duration programmatically #34

Open
amirjelo opened this issue Jan 2, 2015 · 2 comments
Open

how to set duration programmatically #34

amirjelo opened this issue Jan 2, 2015 · 2 comments
Labels

Comments

@amirjelo
Copy link

amirjelo commented Jan 2, 2015

i want to change the duration of DonutOutputCache attribute from database record.

so i just write a custom outputcache which is childof DonutOutputCacheAttribute :
public class CmsOutputCache : DonutOutputCacheAttribute
{
public CmsOutputCache()
{
var setting = SettingBL.GetAdvancedSetting();
this.Duration = setting.TimeCache * 15;

    }
}

and use it like this :
[ChildActionOnly]
[CmsOutputCache]
public ActionResult HeaderSlider(){}

but the behavior of caching not working now!
how to set duration?

@moonpyk
Copy link
Owner

moonpyk commented Mar 27, 2015

Can you upload a test project so that I can reproduce the issue or tell you what is wrong ?

@migig
Copy link

migig commented Sep 25, 2015

@amir-yeketaz We needed something similar, and it worked for us. So it should be possible.

@moonpyk moonpyk added the pending label Apr 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants