OutputCacheSettingsSection クラス
アセンブリ: System.Web (system.web.dll 内)


OutputCacheSettingsSection クラスを使用すると、構成ファイル内の caching セクションの outputCacheSettings 要素にプログラムからアクセスして変更できます。出力キャッシュ設定は、たとえば @ OutputCache ディレクティブや OutputCacheProfile によって出力キャッシングで使用される依存関係 (キャッシュに格納されているアイテムと、ファイル、キャッシュ キー、または CacheDependency オブジェクト間の関係) を定義します。
![]() |
---|
OutputCacheSettingsSection は、値が MachineToApplication のセクション プロパティ AllowDefinition で定義される制限に従って、構成ファイルの関連するセクションに情報を書き込むことができます。階層構造の許可されていないレベルで構成ファイルに書き込みを行おうとした場合、パーサーによってエラー メッセージが生成されます。ただし、このクラスを使用して、階層構造の任意のレベルに構成情報を読み込むことができます。 |

既存の Web アプリケーションの構成ファイルから OutputCacheSettingsSection オブジェクトを取得する方法を次のコード例に示します。
' 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 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);

System.Configuration.ConfigurationElement
System.Configuration.ConfigurationSection
System.Web.Configuration.OutputCacheSettingsSection


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- OutputCacheSettingsSection クラスのページへのリンク