OutputCacheSettingsSection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
アプリケーション ページの出力キャッシュ設定を構成します。 このクラスは継承できません。
public ref class OutputCacheSettingsSection sealed : System::Configuration::ConfigurationSection
public sealed class OutputCacheSettingsSection : System.Configuration.ConfigurationSection
type OutputCacheSettingsSection = class
inherit ConfigurationSection
Public NotInheritable Class OutputCacheSettingsSection
Inherits ConfigurationSection
- 継承
例
次のコード例は、既存の Web アプリケーションの OutputCacheSettingsSection 構成ファイルから オブジェクトを取得する方法を示しています。
// 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 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)
注釈
OutputCacheSettingsSectionクラスを使用すると、構成ファイル内の セクションの caching
要素にプログラムでアクセスして変更outputCacheSettings
できます。 出力キャッシュ設定では、出力キャッシュで使用される依存関係 (キャッシュに格納されている項目とファイル、キャッシュ キー、または CacheDependency オブジェクト間のリレーションシップ) を定義します。たとえば、 @ OutputCache ディレクティブまたは によって が使用されます OutputCacheProfile。
注意
ではOutputCacheSettingsSection、 の値MachineToApplicationが である section プロパティAllowDefinitionで定義されている制限に従って、構成ファイルの関連セクションに情報を書き込むことができます。 階層内で許可されていないレベルで構成ファイルに書き込もうとすると、パーサーによってエラー メッセージが生成されます。 ただし、このクラスを使用すると、階層内の任意のレベルで構成情報を読み取ることができます。
コンストラクター
OutputCacheSettingsSection() |
OutputCacheSettingsSection クラスの新しいインスタンスを初期化します。 |