how to cache part of a page without using fragment caching

Discussion in 'ASP .Net' started by sam, Mar 7, 2006.

  1. sam

    sam Guest

    Hi,
    I know fragment caching where you can use a cached user control in a
    non-cached page (or the opposite)

    But without using a user control, how can I cache just a part of my
    page (two datatables) but not the rest of the page ?
     
    sam, Mar 7, 2006
    #1
    1. Advertising

  2. Well, if you actually want to cache objects, such as DataTables, you can use
    the cache API,

    function GetDate() as DataTable
    dim cacheKey as string = "SomeUniqueKey"
    dim dt as DataTable = ctype(Cache(cacheKey), DataTable)
    if (dt is nothing) then
    dt = getTheDataFromTheDatabase()
    Cache.Insert(cacheKey, dt, null, DateTime.Now.AddMinutes(10),
    Timespan.Zero)
    end if
    return dt
    end function

    --
    http://www.openmymind.net/
    http://www.fuelindustries.com/


    "sam" <> wrote in message
    news:...
    > Hi,
    > I know fragment caching where you can use a cached user control in a
    > non-cached page (or the opposite)
    >
    > But without using a user control, how can I cache just a part of my
    > page (two datatables) but not the rest of the page ?
    >
     
    Karl Seguin [MVP], Mar 7, 2006
    #2
    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. quique

    fragment page caching

    quique, Oct 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    367
    quique
    Oct 30, 2003
  2. Troy Simpson

    Fragment Caching inside page caching?

    Troy Simpson, Jan 19, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    810
    Troy Simpson
    Jan 19, 2004
  3. =?Utf-8?B?Sm9l?=

    fragment caching problem

    =?Utf-8?B?Sm9l?=, May 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    331
    Mr. Dot Net
    Jul 15, 2004
  4. DC
    Replies:
    3
    Views:
    850
    Juan T. Llibre
    Oct 18, 2005
  5. JimLad
    Replies:
    3
    Views:
    930
    JimLad
    Jan 21, 2010
Loading...

Share This Page