Professional Documents
Culture Documents
Lab 14 Manual 05012023 091712pm
Lab 14 Manual 05012023 091712pm
Lab 14 Manual 05012023 091712pm
State Management
2- Create another webform with name “SessionState2” and copy the code from
SessionState1 and paste it into this application.
3- Run the application (SessionState1) in Google Chrome using Ctrl+F5 and
increment the value of text item by clicking the button.
4- Create another instance of web application by opening SessionState2 in Web browser.
5- You will see that same value has been passed in that window.
6- Now close all chrome tabs. Your session will be expired.
Example 2
Global.asax file
Create a new application and configure the Global.asax file of your application
according to the given code.
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application["totalApps"] = 0;
Application["totalSessions"] = 0;
Application["totalApps"] = (int)Application["totalApps"] + 1;
}
About.aspx.cs file