If you are planning on storing user specific information in ASP.Net, then you need to use the session objects. You might want to get all the values that you have stored in a particular session object. Let’s say there are three page.aspx, and you are storing values in each of these pages. Let’s say one of the page.aspx is used to print the session keys with its values.
You need to understand the process to retrieve the session values in ASP.Net
Let’s first check the individual pages
In this Page1.aspx.cs, you will store one value ID for the session
Session["Id"] = "1";
Similarly, in Page2.aspx.cs
Session["Name"] = "XYZ";
In, Page3.aspx.cs, you will retrieve the values that you have stored in the preceding pages.
You have three methods of retrieving the session values when you are dealing with ASP.Net. Here we will discuss each of the methods, and then zero down on the output
Method One
In this method, you will be looping the session.contents in order to get the keys used in the session. Using these keys, you will be able to retrieve the session values
protected void Page_Load(object sender, EventArgs e)