How to get to Cache from Class

Discussion in 'ASP .Net' started by Keith Chadwick, Nov 4, 2003.

  1. Need some help on access the httpApplication cache.

    I was informed to use the application cache over the old application object
    and also to use a classes versus modules.

    do I need to Imprt System.Web.HttpApplication into the class?

    do I need to dim x as System.Web.Application then use
    x.context.cache.item("myitem")=myobject

    How exactly do I get to the application cache from within a class as none of
    the above seems to work?

    Thanks
    Keith
     
    Keith Chadwick, Nov 4, 2003
    #1
    1. Advertising

  2. http://samples.gotdotnet.com/quickstart/aspplus/doc/datacaching.aspx

    "Keith Chadwick" <> wrote in message
    news:ez$...
    > Need some help on access the httpApplication cache.
    >
    > I was informed to use the application cache over the old application

    object
    > and also to use a classes versus modules.
    >
    > do I need to Imprt System.Web.HttpApplication into the class?
    >
    > do I need to dim x as System.Web.Application then use
    > x.context.cache.item("myitem")=myobject
    >
    > How exactly do I get to the application cache from within a class as none

    of
    > the above seems to work?
    >
    > Thanks
    > Keith
    >
    >
     
    Dino Chiesa [Microsoft], Nov 5, 2003
    #2
    1. Advertising

  3. The Application Cache is a property of the Current HttpContext. When
    referring to the Application Cache in a Page, you can simply refer to
    "Cache," as it is a property of the Page class If you are referring to the
    Application Cache in a class that is not a Page or HttpHandler, but is used
    by one, you can refer to "HttpContext.Current.Cache."

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    http://www.takempis.com
    Big Things are made up of
    Lots of Little Things.

    "Keith Chadwick" <> wrote in message
    news:ez$...
    > Need some help on access the httpApplication cache.
    >
    > I was informed to use the application cache over the old application

    object
    > and also to use a classes versus modules.
    >
    > do I need to Imprt System.Web.HttpApplication into the class?
    >
    > do I need to dim x as System.Web.Application then use
    > x.context.cache.item("myitem")=myobject
    >
    > How exactly do I get to the application cache from within a class as none

    of
    > the above seems to work?
    >
    > Thanks
    > Keith
    >
    >
     
    Kevin Spencer, Nov 5, 2003
    #3
    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. Jeff Nokes

    Cache::Cache Stale Segments

    Jeff Nokes, Sep 30, 2003, in forum: Perl
    Replies:
    0
    Views:
    589
    Jeff Nokes
    Sep 30, 2003
  2. DesignerX

    Page.Cache vs HttpContext.Current.Cache

    DesignerX, Jan 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,293
    vMike
    Jan 20, 2004
  3. =?Utf-8?B?b25l?=
    Replies:
    1
    Views:
    5,313
    Karl Seguin [MVP]
    Mar 8, 2006
  4. Sergey via DotNetMonster.com

    ASP.NET Cache vs Window System Cache

    Sergey via DotNetMonster.com, Nov 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    487
    Sergey via DotNetMonster.com
    Nov 15, 2006
  5. John
    Replies:
    2
    Views:
    1,195
Loading...

Share This Page