Using ASP.NET Application State Management

Listings 5.1 and 5.2 show a global.asax and a web page that demonstrates some of the properties, methods, and events of the HttpApplicationState class, as explained previously. Figure 5.1 shows the Application State demo program.

Figure 5.1. The Application State demo program.

Listing 5.1. (global.asax) The Application Intrinsic Object in Action
 01 <Script language="vb" runat="Server"> 02 03 Sub Application_OnStart(ByVal sender As Object, ByVal e As EventArgs) 04 Application("appName") = "Application State Management Demo" 05 Application("appDate") = DateTime.Now.ToShortDateString 06 End Sub 07 08 ...

Get Inside 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.