Advertise Here
XML Files - Extensible Markup Language Tutorials for Developers - Web04
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
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

Page 1 of 4 Next Page >

Introduction

ASP+ configuration information is stored in XML-based configuration files. Using built-in features of IIS 5.0 and IE 5.0 such as the FileSystemObject, the XML Document Object Model (DOM) and XML Data Islands, we can easily develop a rich tool for modifying and editing these configuration files. In this three part lesson we will build a web based tool for loading, modifying, and saving the ASP+ config.web configuration file.

In part one (this lesson) we will discuss the contents and structure of the config.web file, then build an ASP+ file for loading the config.web file into a client side DOM object (data island). Part two will feature data-binding the XML DOM object to client intrinsic controls, providing a rich editing environment. Finally, in part three we will post the XML data back to the server and save the new config.web file back to the ASP+ application.

Note: ASP+, config.web, and many other items in this discussion are part of Microsoft's .NET framework, which is still in development and subject to change. Information for these articles has been obtained from preliminary documentation, also subject to change, and from hands on experience working with the .NET framework SDK technology preview.

To run the samples included with this lesson you will need to install the .NET Framework Technology Preview. Visit http://msdn.microsoft.com/net/ for more information.

Welcome to config.web

ASP developers are used to using global configuration files in the form of global.asa and other home built files. ASP+ adds on to this concept of global configuration by providing a true configuration file in the config.web file. Rather than being a global event handler for handling state configuration, the config.web file is a real configuration file for storing system and application settings independent of state.

The config.web file is XML-based, which means that it inherits all of the wonderful features that are the nature of XML files, such as being human-readable and human-writeable, as well as being customizable (extensible). This feature of being extensible means that in addition to storing all of the system configuration items, you can add your own configuration criteria and settings within the configuration system.

Following is an example of a config.web file:


<!-- CONFIG.WEB FILE -->
<configuration>
   <configsections>
      <add names="httpmodules" type="System.Web.Config.HttpModulesConfigHandler"/>
      <add names="httphandlers" type="System.Web.Config.HttpHandlerConfigHandler"/>
      <add names="sessionstate" type="System.Web.Config.SessionStateConfigHandler"/>
      <add names="globalization" type="System.Web.Config.GlobalizationConfigHandler"/>
      <!-- ADDITIONAL CONFIGSECTION DECLARATIONS GO HERE -->
     </configsections>

   <httpmodules>
      <!-- http module subelements go here -->
   </httpmodules>

   <httphandlers>
      <!-- http handlers subelements go here -->
   </httphandlers>

   <sessionstate>
      <!-- session state subelements go here -->
   </sessionstate>

   <globalization>
      <!-- session state subelements go here -->
   </globalization>

   <!-- ADDITIONAL CONFIG SECTIONS GO HERE -->

</configuration>

Notice that all configuration information must reside between the <configuration> and </configuration> tags. The file is made up of two main parts. The first part is the <configsections> section which specifies the configuration section handler declarations. The remainder of the file contains the actual configuration sections, as specified in the <configsections> part. The configuration section handler declarations specify the name of each configuration section, and the .NET assembly and class that will handle that configuration information. For Example:


<configuration>

   <configsections>
      <add name="debugmode" type="System.Web.Config.SingleTagSectionHandler" /> 
      <add name="globalization" type="System.Web.Config.SingleTagSectionHandler" />
      <add name="assemblies" type="System.Web.UI.AssembliesSectionHandler" />
      <add name="security" type="System.Web.Config.SecurityConfigHandler" />
   </configsections>

   <debugmode enable="true" />

   <globalization
      requestencoding="us-ascii"
      responseencoding="iso-8859-1"
   />

   <assemblies>
      <add assembly="System.Data.dll"/>
      <add assembly="System.dll"/>
      <add assembly="System.Drawing.dll"/>
      <add assembly="*"/>
   </assemblies>

   <security>
      <authorization>
         <allow users="*" />
      </authorization>
   </security>
 
</configuration>

The above example demonstrates the use of four configuration sections.


Page 1 of 4 Next Page >

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 DevX XML Content 
- Creating and Deploying SharePoint Solution Files
- Go Public with Your Android Application: Signing and Deployment
- Create XML from an Array
- Utilizing a Multi-Core System with the Actor Model
- Why Migrate to the Semantic Web?

Jump to : Top Of Page or HOME


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

Whitepapers and eBooks

Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Microsoft PDF: Top 10 Reasons to Move to Server Virtualization with Hyper-V
Microsoft PDF: Six Reasons Why Microsoft's Hyper-V Will Overtake Vmware
Microsoft Step-by-Step Guide: Hyper-V and Failover Clustering
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Microsoft PDF: Top 11 Reasons to Upgrade to Windows Server 2008
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
  PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
HP eBook: Guide to Storage Networking
MORE WHITEPAPERS, EBOOKS, AND ARTICLES