Which of the following HttpContext objects provides properties and methods related to individual
users or instances of a Website?
A.
Application
B.
Session
C.
Response
D.
Request
Explanation:
The session object is a top-level object from the HttpContext.Current object. It provides properties
and methods related to individual users or instances of a Website. The Session object is used to
store information or change settings for a user session. Session objects hold information about one
single
user in the form of variables, and are available to all pages in one application.
Answer C is incorrect. The response object is the top level object in the HttpContext.Current object.
It provides the properties and methods related to browser output. This object is used for the
following two purposes:
1.Write text directly to the Web page using its response.
2.Redirect the browser to another page using its Response.Redirect method.
Answer A is incorrect. The application object is a top-level object of HttpContext.Current. It contains
properties and methods related to the currently running application. It is used to store and access
variables from any page, and all users share one Application object. It holds information that will be
used by many pages in the application, and the information can be accessed from any page. The
information can also be modified in one place, and the changes will automatically be reflected on all
pages.
Answer D is incorrect. The request object is a top-level object in the HttpContext.Current object. It
provides properties and methods related to the browser. It is used for retrieving information about
the browser, reading cookies, and passing information directly from the Web page. This object can
also be used with the Response object to display browser information on the Web page.