To gain access to these server-side state mechanisms, you use the Context object.
The Context Object
We mentioned previously that the HttpApplication class makes user state available to the
developer in the Context property of the HttpContext type. The HttpContext class implements
HttpSessionState and HttpApplicationState instances to provide server-side state management.
In this section, we cover these classes in detail, because they are important features of
the ASP.NET request-processing engine, as they provide server-side state mechanisms to web
applications.
Table 3-2 contains a partial description of some of the important properties attached to
the HttpContext class and what capabilities they provide. Refer to the .NET Framework documentation
for more detailed information on the HttpContext class.
Table 3-2. Properties of the HttpContext Class
Property Description
Application Provides server-side state management for all clients of the web
application
ApplicationInstance Reference controls the execution process of the ASP.NET web request
Cache Provides access to the server-side cache in ASP.NET
Error Provides access to the error exceptions that occur during ASP.NET
execution
Items Key/value pair collection used to pass information between the components
in a request
Request Contains information from the client request, including browser type,
cookies, and values encoded in form and URL query string collections
Response Key/value pair collection used to pass information between the
requesting components
Server Provides utilities including Server.
Pages:
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164