Click here to Skip to main content
15,911,711 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ALL,

I have a problem like i have created a web application in asp.net with c# and it is working. it has 14 pages but the problem is if the user want to go back and update the last value then when he go back all the last entries got expired and he does'nt know what was he selected on the last page and at the same time if he again select any value and click the next button then the value he was selected on the next page is also expired.

I want that user can go back and next any time and update the values untill he reach the last page and 20 users use the application at the same time.I know that it is something related to session but how to use it in a right mannar that i do'nt know.SO please help me out to resolve this query.

This is something like online test so at the same time any number of user can access this application and if they want to change something that they mentioned on the last page can change from first page to last.
Posted
Updated 17-Jan-12 1:41am
v2

1 solution

Using Session is easy:
C#
Session["MySessionVariable"] = myVariableValue;
...
myVariableValue = (MyVariableType) Session["MySessionVariable"];
So all you have to do is put a "next" button on you page, and in the Click event handler set the Session variables before you move to the page. When you load a page, yopu read teh session variables back in the Load event, and set the textbox content appropriately.

Because Session holds object values, you can store whatever type you need.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900