| Advertise Here |
|
Using XML to build an ASP+ config.web EditorBy Adam S. Cartwright
ASP+ Standard Section HandlersASP+ ships with several standard section handlers that can be used to process configuration settings within config.web files. The .NET SDK documents each of these standard section handlers in detail with sample code to demonstrate proper syntax. The following is a summary of these standard section handlers:
Custom Configuration SettingsAs I stated above, it is possible to extend the configuration file with your own configuration settings. To do so, all you have to do is create your own Configuration Section Handler, which must be a class that implements the System.Web.Config.IConfigSectionHandler interface. The IConfigSectionHandler interface is defined as follows:
For more information on how to add custom configuration settings, see the .NET Framework SDK. Accessing Configuration SettingsAccessing the configuration settings found in the config.web file is extremely simple and quite straight forward. One thing to remember is that the configuration settings are hierarchical, thus it is possible to have configuration files for specific URLs. Accessing the configuration settings is accomplished by using the GetConfig() method exposed on the HttpContext object. For example:
The above example shows how to access configuration information for the current URL being processed. To access configuration information for a specific URL, use the following example:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Jump to : Top Of Page or HOME |