Language

CacheBehaviorAttribute Class

Definition

Marks a component so that it is not baked into the cached output of an enclosing CacheView, and specifies how it behaves in that case. By default the component stays live (Rerender): it runs its own lifecycle on every request while its parameters are captured once and replayed unchanged on cache hits. Use Throw to throw instead of rendering live.

Combine with CacheConditionAttribute to include the component in the cached output when the boundary varies by the given dimensions.

[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
public sealed class CacheBehaviorAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=false, Inherited=true)>]
type CacheBehaviorAttribute = class
    inherit Attribute
Public NotInheritable Class CacheBehaviorAttribute
Inherits Attribute
Inheritance
CacheBehaviorAttribute
Attributes

Constructors

Name Description
CacheBehaviorAttribute(CacheBehavior)

Initializes a new instance of the CacheBehaviorAttribute class.

Properties

Name Description
Behavior

Gets the behavior to apply when the component cannot be baked into the cached output of an enclosing CacheView.

Applies to