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 기존 웹 애플리케이션을 사용 하 여 연결 된 구성 파일에서 개체입니다.
// 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 읽고에서 섹션 속성에 따라 구성 파일의 관련 섹션 정보를 쓸 수 있습니다 AllowDefinition 값인 Everywhere합니다.
생성자
WebControlsSection() |
WebControlsSection의 새 인스턴스를 만듭니다. |