Global.asax

Every ASP.NET application, by default, gets a Global.asax file. This file contains six methods that the ASP runtime calls when appropriate. The methods include Application_Start(), Session_Start(), Application_BeginRequest(), Application_EndRequest(), Session_End(), and Application_End(). The most commonly used of these are the Application_Start() and the Session_Start() methods. These are especially valuable because the Application_Start() method can store into application variables any data that the application will use while it is alive. The Session_Start() method can create and set up any kind of session variables that are needed for a user’s session. This means that your job of maintaining state is easier because you have guaranteed ...

Get Special Edition Using® Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.