Application Settings Files

ASP.NET applications can be configured through two different file-based mechanisms:

  • global.asax— Global application setting file.

  • web.config— XML-based application configuration file.

The global.asax File

The global.asax file has two main purposes:

  • To enable you to define application- and session-wide variables, objects, and data.

  • To enable you to define event handlers for application- and session-based events that happen in the scope of the application.

Directives Used in the global.asax File

The global.asax file can include the following possible elements:

  • The @Assembly directive— Is used to register a compiled assembly with the web application; another way to register assemblies is to use the web.config file, ...

Get Inside ASP.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.