0% found this document useful (0 votes)
2 views11 pages

Session

Session is a mechanism in web applications that allows for the storage and retrieval of user-specific values during navigation across pages. ASP.NET session state enables this functionality by identifying requests from the same browser within a limited time frame, allowing stored values to be accessed from any page in the application. By default, session state is enabled in ASP.NET applications, facilitating the sharing of variable values across multiple pages.

Uploaded by

godsonsoban0342
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views11 pages

Session

Session is a mechanism in web applications that allows for the storage and retrieval of user-specific values during navigation across pages. ASP.NET session state enables this functionality by identifying requests from the same browser within a limited time frame, allowing stored values to be accessed from any page in the application. By default, session state is enabled in ASP.NET applications, facilitating the sharing of variable values across multiple pages.

Uploaded by

godsonsoban0342
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

SESSION

Session is a state that is used to store and retrieve values of a user while the user
is navigating between pages in a web application
It is used to store value for the particular time session

The server retains no knowledge of variable values that were used during previous
requests. ASP.NET session state identifies requests from the same browser during
a limited time window as a session, and provides a way to persist variable values
for the duration of that session. .

By default, ASP.NET session state is enabled for all ASP.NET applications.

The value stored in a session variable can be accessed from any page within the
same project.

For Eg: Assume a web application have 5 pages named Page 1,2,3,4,5. if we store
a session variable called X in Page1, then the value of that variable can be
retireved in Page2, 3,4,5.
Assume Page1 contains Textbox1 and Textbox2
Assume Page2 contains one Textbox named Textbox1
Assume there are 3 pages in Solution

Storing value of Textbox 1 and 2 in the


variables s1 and s2 in Page 1:
Session(“s1”) = Textbox1.Text;
Session(“s2”) = Textbox1.Text;
Retrieving the values in Page 2 or Page 3
Textbox1.Text=Session(“s1”).ToString();

You might also like