Chapter 17: The Application and HTTP Modules


Chapter 17

The Application and HTTP Modules

After completing this chapter, you will be able to

  • Use HttpApplication as a rendezvous point for your application

  • Manage data within the HttpApplication object

  • Manage events within the HttpApplication object

  • Work with HTTP Modules

This chapter covers working with application state and application-wide events within your ASP.NET application. In normal desktop applications, the notion of a global meeting place for various parts of an application is well-understood. For example, MFC, a C++ class library supporting low-level Windows development, includes a class named CWinApp that holds state useful throughout the program. This state includes such items as a handle to the current instance of the application, a handle to the main window, and the parameters that were passed in when the application started. The CWinApp class also runs the message loop—something that can be done only within the global scope of a Windows application. A running Windows application contains one and only one instance of the CWinApp class, and it's perennially available from anywhere within the application.

Windows Forms—the .NET library supporting Windows forms—has a similar class named Application. It includes the same sort of state (command line parameters, a top-level window, other state required by the program). The Windows Forms Application class also runs the message loop.

Web development also requires the same sort of “global space” that a desktop application requires. Having a global space within a Web application makes implementing features such as caching data and session state possible. Let's take a look at how ASP.NET implements a global space for Web applications.




Microsoft ASP. NET 2.0 Programming Step by Step
Microsoft ASP.NET 2.0 Step By Step (Step By Step (Microsoft))
ISBN: B002KE5VYO
EAN: N/A
Year: 2005
Pages: 177

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net