ControlCachePolicy.Cached 属性

定义

获取或设置一个值,该值指示是否为用户控件启用片段缓存。Gets or sets a value indicating whether fragment caching is enabled for the user control.

public:
 property bool Cached { bool get(); void set(bool value); };
public bool Cached { get; set; }
member this.Cached : bool with get, set
Public Property Cached As Boolean

属性值

Boolean

如果缓存用户控件的输出,则为 true;否则为 falsetrue if the user control's output is cached; otherwise, false.

例外

用户控件与 BasePartialCachingControl 没有关联,因此不可缓存。The user control is not associated with a BasePartialCachingControl and is not cacheable.

- 或 --or- Cached 属性是在控件的初始化和呈现阶段之外设置的。The Cached property is set outside of the initialization and rendering stages of the control.

适用于