Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to cache part of a page without using fragment caching

Reply
Thread Tools

how to cache part of a page without using fragment caching

 
 
sam
Guest
Posts: n/a
 
      03-07-2006
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 ?

 
Reply With Quote
 
 
 
 
Karl Seguin [MVP]
Guest
Posts: n/a
 
      03-07-2006
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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 ?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable page caching without disabling caching of jpegs andstylesheets etc JimLad ASP .Net 3 01-21-2010 10:13 AM
Globally turn page fragment caching off? DC ASP .Net 3 10-18-2005 02:51 PM
fragment caching problem =?Utf-8?B?Sm9l?= ASP .Net 1 07-15-2004 09:47 PM
Fragment Caching inside page caching? Troy Simpson ASP .Net 0 01-19-2004 11:57 AM
fragment page caching quique ASP .Net 0 10-30-2003 11:17 AM



Advertisments