views:

423

answers:

2

I heard on a recent podcast (Polymorphic) that it is possible to cache a user control as opposed to the entire page.

I think my header control which displays static content and my footer control could benefit from being cached.

How can I go about caching just those controls?

+4  A: 

take a look here

you use VaryByParam and VaryByControl in the output cache.

Mike
+1  A: 

I think you can specify OutputCache in the control's markup file like you'd do on an ASPX page. And it'd get properly cached automatically.

Just read up on OutputCache page directive on MSDN and get the parameters right and it should do what you want it to.

It's been a long time since I write classic ASP.NET but I believe that's how it's done.

chakrit