specify output cache settings in the codebehind???

Discussion in 'ASP .Net' started by alex, Dec 28, 2004.

  1. alex

    alex Guest

    Ok there are two ways to specify output cache settings for the user
    control.

    1) using attributes

    [PartialCaching(20)]
    public class ctlMine : UserControl{}

    2) and using @ OutputCache directive.

    They both are "static". Now if I need to load a user control into
    various pages and specify particular output caching settings per page,
    how do I do this? What is the way to set it in the codebehind using
    variables for cache duration, etc.

    I can create a class:
    System.Web.UI.PartialCachingAttribute cacheRules = new
    System.Web.UI.PartialCachingAttribute(CacheDuration, null, null, null);
    but how to I attach it to the control?

    Thanks.
     
    alex, Dec 28, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Moore

    detect cache settings

    Ryan Moore, Feb 3, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    368
    Ryan Moore
    Feb 3, 2004
  2. Replies:
    5
    Views:
    6,856
    Damien
    Oct 5, 2005
  3. Siegfried Heintze
    Replies:
    0
    Views:
    2,279
    Siegfried Heintze
    Oct 24, 2005
  4. leeanne
    Replies:
    0
    Views:
    1,877
    leeanne
    Sep 24, 2008
  5. donet programmer
    Replies:
    3
    Views:
    1,553
    Gregory A. Beamer
    Nov 20, 2009
Loading...

Share This Page