Web Tutorials

Interview Q & A

Code Examples

Utility Tools

ASP.NET OutputCache Directive Attributes

ASP.NET OutputCache directive is defined at page level and used by the ASP.NET page parser and compiler.

Syntax

<%@ OutputCache attribute="value" [attribute="value"...] %>    

ASP.NET OutputCache Directive Attributes

AttributesDescription
CacheProfileSpecifies name of cache profile details in the web.config.
DiskCacheableSpecifies whether to save cache on disk.
DurationSpecifies duration time in seconds of output cache.
LocationSpecifies the location of cache.
NoStoreSpecifies whether to send no-store header with page.
SqlDependencySpecifies to enable SQL Server cache invalidation for page.
VaryByControlSpecifies string to vary the output cache.
VaryByCustomSpecifies string to customoutput cache.
VaryByHeaderSpecifies HTTP headers to vary the output cache.
VaryByParamSpecifies string to vary output cache.

ASP.NET OutputCache Directive Attributes Example C#

<%@ OutputCache Duration="200"  VaryByParam="None" %>

RequiredFieldValidator

RegularExpressionValidator

RangValidator

CompareValidator

CustomValidator

ValidationSummary