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


WebControlsSection クラスを使用すると、構成ファイルの webControls セクションにプログラムからアクセスして変更できます。
![]() |
---|
ASP.NET は、クライアント スクリプト ファイルの共有場所を提供します。ここに存在するファイルは、複数のページやアプリケーション全体からアクセスされます。WebControlsSection は、値が Everywhere のセクション プロパティ AllowDefinition に従って、構成ファイル内の関連するセクションから情報を読み込んだり、このセクションに情報を書き込んだりできます。 |

既存の Web アプリケーションに関連付けられている構成ファイルから WebControlsSection オブジェクトを取得する方法を次のコード例に示します。
' Get the Web application configuration. Dim configuration _ As System.Configuration.Configuration = _ WebConfigurationManager.OpenWebConfiguration( _ "/aspnetTest") ' Get the <webControls> section. Dim webControlsSection _ As WebControlsSection = _ CType(configuration.GetSection( _ "system.web/webControls"), WebControlsSection) ' Read the client script location. Dim clientScriptLocation As String = _ webControlsSection.ClientScriptsLocation Dim msg As String = _ String.Format( _ "Client script location: {0}" + _ ControlChars.Lf, clientScriptLocation) Console.Write(msg)
// Get the Web application configuration. System.Configuration.Configuration configuration = WebConfigurationManager.OpenWebConfiguration( "/aspnetTest"); // Get the <webControls> section. WebControlsSection webControlsSection = (WebControlsSection)configuration.GetSection( "system.web/webControls"); // Read the client script location. string clientScriptLocation = webControlsSection.ClientScriptsLocation; string msg = String.Format( "Client script location: {0}\n", clientScriptLocation); Console.Write(msg);

System.Configuration.ConfigurationElement
System.Configuration.ConfigurationSection
System.Web.Configuration.WebControlsSection


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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