WebControlsSection Class
.NET Framework 2.0
Configures the webControls section. This class cannot be inherited.
Namespace: System.Web.Configuration
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The WebControlsSection class provides a way to programmatically access and modify the webControls section of a configuration file.
Note: |
|---|
|
ASP.NET provides a shared location for the client script files, where they can be accessed from multiple pages and across applications. The WebControlsSection can read and write information from and to the related section of the configuration file according to the section property AllowDefinition whose value is Everywhere. |
| Topic | Location |
|---|---|
| How to: Secure Connection Strings When Using Data Source Controls | Building ASP .NET Web Applications |
| How to: Secure Connection Strings When Using Data Source Controls | Building ASP .NET Web Applications |
| How To: Secure Connection Strings when Using Data Source Controls (Visual Studio) | Building ASP .NET Web Applications in Visual Studio |
The following code example shows how to obtain the WebControlsSection object from the configuration file associated with an existing Web application.
// 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.Object
System.Configuration.ConfigurationElement
System.Configuration.ConfigurationSection
System.Web.Configuration.WebControlsSection
System.Configuration.ConfigurationElement
System.Configuration.ConfigurationSection
System.Web.Configuration.WebControlsSection
Community Additions
ADD
Show:
Note: