WebControlsSection クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
webControls
セクションを構成します。 このクラスは継承できません。
public ref class WebControlsSection sealed : System::Configuration::ConfigurationSection
public sealed class WebControlsSection : System.Configuration.ConfigurationSection
type WebControlsSection = class
inherit ConfigurationSection
Public NotInheritable Class WebControlsSection
Inherits ConfigurationSection
- 継承
例
次のコード例は、既存の WebControlsSection Web アプリケーションに関連付けられている構成ファイルから オブジェクトを取得する方法を示しています。
// 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);
' 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)
注釈
WebControlsSection クラスを使用すると、構成ファイルの webControls
セクションにプログラムからアクセスして変更できます。
注意
ASP.NET は、クライアント スクリプト ファイルの共有の場所を提供します。クライアント スクリプト ファイルは、複数のページから、およびアプリケーション間でアクセスできます。 はWebControlsSection、値Everywhereが である section プロパティAllowDefinitionに従って、構成ファイルの関連セクションとの間で情報の読み取りと書き込みを行うことができます。
コンストラクター
WebControlsSection() |
WebControlsSection の新しいインスタンスを作成します。 |