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

Search XML Files:

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
International

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 
- Semantic Search Arrives at the Web
- Introduction to the Live Search API
- Persisting Data in Your Windows Mobile Device
- Generating Reports and Statistics in PHP
- Leveraging Silverlight 2 with SQL Server and XML

Jump to : Top Of Page or HOME




JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers