OutputCache a WebControl
-
Dear CPians, I is there a way to use OutputCache in WebControls? It is very easy to use it in UserControls, But what happens with WebControls? Am I missing something important? Thanking you in advance.
Excellence is not an act, but a habit!
Aristotle
-
Dear CPians, I is there a way to use OutputCache in WebControls? It is very easy to use it in UserControls, But what happens with WebControls? Am I missing something important? Thanking you in advance.
Excellence is not an act, but a habit!
Aristotle
Basically, you can only use the
OutputCache
directive with a content element like the web page or web user control, and at runtime the ASP.NET parser will process this directive to decide if it should initialize the element from scratch or simply get the output markup from cache. For the custom control, you cannot apply this directive and if you want to support caching for custom controls, you'll need to think of other solutions. For example, you simply use a web user control as a container for your webcontrol.