WebPart.CacheType 属性

确定的缓存正在使用的 Web 服务器的类型。

命名空间:  Microsoft.SharePoint.WebPartPages
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Protected ReadOnly Property CacheType As CacheType
    Get
用法
Dim value As CacheType

value = Me.CacheType
protected CacheType CacheType { get; }

属性值

类型:Microsoft.SharePoint.WebPartPages.CacheType
一个CacheType枚举值。

备注

如果为 Web 服务器缓存的类型 (在 web.config 文件<WebPartCache Storage="Database" />),设置为数据库和 Web 部件中的代码会尝试缓存未标记为可序列化的对象,则该对象是不缓存和性能会受到影响。若要优化您的代码,请使用CacheType属性以防止在这种情况下使用缓存。

另请参阅

引用

WebPart 类

WebPart 成员

Microsoft.SharePoint.WebPartPages 命名空间