Chapter 18. Application Logic and Configuration

ASP.NET provides easy access to application-wide program logic through the Global.asax file. This text file allows you to create event handlers for many events exposed by the application as a whole and by individual sessions. You can also include variables and methods that will apply globally to the entire application.

You can configure web applications using the XML configuration files machine.config and web.config, which provide a flexible and hierarchical configuration scheme. Configuration settings can apply to every application on the web server, to specific applications, or to specific subdirectories within an application. New to Windows Vista and Windows Server 2008 as a complement to ASP.NET 3.5 is the ability to configure Internet Information Services (IIS) 7.0 through web.config and use it to change web.config, in addition to the Web Site Administration Tool (WAT) in Visual Studio 2008 (VS2008). If you’re using Windows XP, you also can use IIS 5.1 and its ASP.NET Configuration Settings dialog box as an alternative to hand-editing application-specific configuration files.

Because all of the configuration and control for ASP.NET applications is done with text files, either XML or some other variant of plain text, you can maintain and update a web application remotely. You don’t need to be physically present at a web server to reconfigure the application through IIS (though access to these files is tightly controlled so that your ...

Get Programming ASP.NET 3.5, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.