Advertise Here
XML Files - Extensible Markup Language Tutorials for Developers - Web06
Extensible Markup Language

Search XML Files:

XML Files RSS Feed XML Files Updates

 

DEVELOPER CHANNEL
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

Find a Web Host With:
CGI Capabilities
Active Server Pages
Windows Hosting
Unix Hosting
Dedicated Servers
     
 Advanced Search
 Be a Commerce Partner















IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

Using XML to build an ASP+ config.web Editor

By
Adam S. Cartwright

< Previous Page Page 2 of 4 Next Page >

ASP+ Standard Section Handlers

ASP+ 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:

  • <browsecaps> : Configures the settings for the browser capabilities component.
  • <compilation> : Contains all the compilation settings.
  • <configuration> : Root configuration section for all ASP+ configuration files.
  • <configsections> : Contains a list that indicates the configuration section handlers associated with each configuration section.
  • <globalization> : Configures the globalization settings of the application.
  • <httphandlerfactories> : Maps incoming URL requests to IHttpHandlerFactories.
  • <httphandlers> : Maps incoming URL requests to IHttpHandler classes.
  • <httpmodules> : Adds, removes or clears Http Modules within an application.
  • <processmodel> : Configures the ASP+ process model settings on IIS Web Server systems.
  • <security> : Configures all security settings used by ASP+.
  • <sessionstate> : Configures the session state HttpModule.
  • <tracing> : Configures the ASP+ trace service.

Custom Configuration Settings

As 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:

namespace System.Web.Config
{
   public interface IConfigSectionHandler
   {
      public Object Create(Object parent, 
                           ConfigInput[] input, 
                           String path);
   }
}

For more information on how to add custom configuration settings, see the .NET Framework SDK.

Accessing Configuration Settings

Accessing 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:


SessionStateConfig config = (SessionStateConfig)
                             Context.GetConfig("sessionstate");

if (config.CookieLess == true)  {
   // Cookieless sessions are activated…
}

if (config.InProc == true) {
   // InProc session state is being used….
}

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:


SessionStateConfig config = (SessionStateConfig)
                   Context.GetConfig("sessionstate", "/MyDir/MyApp.aspx");

if (config.CookieLess == true)  {
   // Cookieless sessions are activated…
}

if (config.InProc == true) {
   // InProc session state is being used….
}

< Previous Page Page 2 of 4 Next Page >

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 DevX XML Content 
- W3C Has a New XML Standard: XProc
- Create a Map Client with Web Services, Part II
- Why Data as a Service Will Reshape EAI
- Transitioning from XSLT 1.0 to 2.0, Part 2
- Transition from XSLT 1.0 to XSLT 2.0, Part 1

Jump to : Top Of Page or HOME


Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers