Previous Page
Next Page

Global.asax versus HttpModules

Both the application object expressed through Global.asax and HTTP Modules offer a rendezvous point for your application. You can use both of them to store global state between requests as well as respond to application-wide events. When choosing one over the other, remember that Global.asax really goes with your application. Global.asax is intended to manage state and events specific to your application. HTTP Modules exist as completely separate assemblies. They're not necessarily tied to a particular application, and may even be signed and deployed in the Global Assembly Cache. That makes Modules an ideal vehicle for implementing generic functionality that's useful between different applications.


Previous Page
Next Page