What are the Application_Start and Session_Start subroutines used for?- These subroutines set the variables for the Application and Session objects. - These subroutines are important in ASP.NET. - When we browse one page and we are moving from one page to another, the values of previous page will get lost. If we want to hold the previous values we can use session level variable or application level variable.
Session_Start: - This subroutine runs at the beginning of a request if the request begins a new session. - It is used to initialize the session variables and to track session related information.
Application_Start: - It is called when the first resource in an ASP.NET application is requested. - This method is called only one time during the life cycle of an application.
|