I have the following questions to ask about using session variables in a C# 2010 web form application that I am working on:
1. Do session variables exist on one one web page and/or can you pass the session variables between two web pages in the same web application? Can the session variables be shared between the two web pages? Can you explain your answer?
2. When a user is logged into a data web application that is used to update 2 tables in a sql server 2008 r2 database and uses session variables, do the session variables retain the their values?
Basically a user enters information for customer One and updates the database. Now the user needs to enter information for a different customer that is customer number two. The user returns to the first of a series of web pages to enter the informnation for customer two.
Do the session variables between when data is entered for customer One and the start of customer two retain the same value? If so, can you tell me how to clear out the values for those session variables when the user goes to enter data for the second customer? If not, can you tell me how the session variables get automatically cleared out?
Loading
Anil KumarPosted Jun 23, 2012, 2:01 AM
You can also overwrite the previous values stored in session variable instead of clearing.
ex
Session["sessionVariableName"] = "i m assigning new value"];
Anil KumarPosted Jun 23, 2012, 1:56 AM
it removes all content from the object and keep the same session key alive.
scampercatPosted Jun 22, 2012, 3:58 PM
Anil KumarPosted Jun 22, 2012, 2:24 PM
2) DO
And for your rest doubts (without numbers), let me ask you what kind of date are you storing into your session variables? Does you customer entry form goes into more than 1 pages?