asp.net.ph

WebControlsSection Class

System.Web.Configuration Namespace


.NET Framework version 2.0

Provides programmatic access to the webControls configuration file section. This class cannot be inherited.

WebControlsSection Class Members

Collapse   Constructors

Visibility Constructor Parameters
public WebControlsSection ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public ClientScriptsLocation String [ Get ]

Collapse   Methods

Visibility Name Parameters Return Type
protected GetRuntimeObject ( ) Object

Remarks

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.

Example

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.
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 );
  C# VB

See Also

ASP.NET Configuration   <webControls> Section Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph