O'Reilly logo

ADO.NET Programming in Visual Basic™ .NET by Bob Howell, Steve Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Maintaining Session State

The main thing to understand here is that Web Forms (or the code behind the Web Forms) have to execute each time a request comes from the user. They process the request and then terminate. This makes things like module-level variables unusable for storing data that must persist for the entire session. Ah! A new word, session. Web applications use something called session state to maintain context between requests. The session state is maintained by IIS itself, so we don’t have to worry about the program terminating and losing its data.

The session exists outside the memory space of the executing code, so it is not lost. There is an intrinsic object called the Session object that is accessible from any Web Form’s code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required