Which of the following events is invoked only once throughout the life cycle of an application and is
invoked when the first resource in an ASP.NET application is requested?
A.
Application_End
B.
Application_Start
C.
Application_LogRequest
D.
Application_Error
Explanation:
The Application_Start method is invoked when the first resource in an ASP.NET application is
requested. It is invoked only once throughout the life cycle of an application. It can be used to
perform startup tasks, such as loading data into the cache and initializing static values. Only static
data should be set during application start. However, do not set any instance data, as the
Application_Start method will be available only to the first instance of the HttpApplication class that
is created.
Answer A is incorrect. This event is triggered when an application is terminated.
Answer D is incorrect. This event is triggered when an error occurs on a site.
Answer C is incorrect. This event is triggered when a request has been made to the application; it is
used for custom logging.