OutputCacheProfileCollection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示 OutputCacheProfile 对象集合。 此类不能被继承。
public ref class OutputCacheProfileCollection sealed : System::Configuration::ConfigurationElementCollection
[System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.OutputCacheProfile))]
public sealed class OutputCacheProfileCollection : System.Configuration.ConfigurationElementCollection
[<System.Configuration.ConfigurationCollection(typeof(System.Web.Configuration.OutputCacheProfile))>]
type OutputCacheProfileCollection = class
inherit ConfigurationElementCollection
Public NotInheritable Class OutputCacheProfileCollection
Inherits ConfigurationElementCollection
- 继承
- 属性
示例
下面的代码示例演示如何获取 OutputCacheProfileCollection 对象。
// Get the Web application configuration.
System.Configuration.Configuration webConfig =
WebConfigurationManager.OpenWebConfiguration("/aspnetTest");
// Get the section.
string configPath =
"system.web/caching/outputCacheSettings";
System.Web.Configuration.OutputCacheSettingsSection outputCacheSettings =
(System.Web.Configuration.OutputCacheSettingsSection)webConfig.GetSection(
configPath);
// Get the profile collection.
System.Web.Configuration.OutputCacheProfileCollection outputCacheProfiles =
outputCacheSettings.OutputCacheProfiles;
' ' Get the Web application configuration.
Dim webConfig _
As System.Configuration.Configuration = _
WebConfigurationManager.OpenWebConfiguration( _
"/aspnetTest")
' Get the section.
Dim configPath As String = _
"system.web/caching/outputCacheSettings"
Dim outputCacheSettings _
As System.Web.Configuration.OutputCacheSettingsSection = _
CType(webConfig.GetSection(configPath), _
System.Web.Configuration.OutputCacheSettingsSection)
' Get the profile collection.
Dim outputCacheProfiles _
As System.Web.Configuration.OutputCacheProfileCollection = _
outputCacheSettings.OutputCacheProfiles
注解
OutputCacheProfileCollection允许集中管理页面或用户控件使用的输出缓存设置。
它允许你以编程方式访问和修改 OutputCacheProfile 它包含的对象。
注意
OutputCacheProfile可以使用 @ OutputCache 指令的 属性将 应用于页面CacheProfile。
构造函数
| OutputCacheProfileCollection() |
初始化 OutputCacheProfileCollection 类的新实例。 |
属性
方法
显式接口实现
| ICollection.CopyTo(Array, Int32) |
将 ConfigurationElementCollection 复制到数组。 (继承自 ConfigurationElementCollection) |
扩展方法
| Cast<TResult>(IEnumerable) |
将 IEnumerable 的元素强制转换为指定的类型。 |
| OfType<TResult>(IEnumerable) |
根据指定类型筛选 IEnumerable 的元素。 |
| AsParallel(IEnumerable) |
启用查询的并行化。 |
| AsQueryable(IEnumerable) |
将 IEnumerable 转换为 IQueryable。 |