A session is the period of time in which a single user interacts with an application, no matter how many individual pages he or she visits.
The state of a page refers to the current values of all controls on the page, including any changes made by the user.
Trace="True" attribute to
Page directive to see the page
Trace, including the stages of the page life cycle, and the control
The postback mode is determined in the Start phase of the life cycle.
Page_Load event is the most
common event to handle if you want to take actions during the Load
ASP.NET manages Control state, View state, Session state, and Application state. You cannot affect the management of the Control state.
attribute disables view state for more complex controls. Simpler
controls, such as text boxes, retain their state no matter what.
Use the state bag to store the value of a counter that increments each time the page is loaded. If you navigate to a separate page, the counter will reset, but not if you click the browser's Refresh button.
Save the user's name in session state.
Use the syntax Session
Exercise 7-1. The trick to this exercise
isn't the code—it's where you put it. You want to evaluate the
IsPostBack attribute, and take action based on its
value, so the best place to do that is in the
Page_Load event. Just a simple bit of code in the
Page_ Load ...