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

I want to create a unique session ID for all evry time user use my application and he can view and change the last activity that hi did on the last page whenever he want while using the the application.

The applicaiton is sort of a quiz so there will be a option to go back and next without losing the last answer in the application.User can go back and make some changes until he compelete the application.

My problem is when go back all the data store in database but not displayed on the page and for that i have used session but it shows the same data that entered first to all the users

If any body have any other solution for this problem that can be acceptable.

Any Help is Appreciated.

Thanks
Posted
Updated 27-Feb-12 23:42pm
v2

Hello,

I know 2 ways:

1. use GUID as Session and store it in database as a code

For example:

SQL
Select  * From Question
   Where Code = @UserID


2. After registering user, before starting the exam, store user's information in database with an ID then get the ID (How? Scope_Identity)

You know the ID in database must be Identity(1,1)

Then:

C#
Session["ExamineeID"] = gotID;


Then you can request for privious questions with ExamineeID.

I prefer the second way. I don't trust to GUID very much ;)
 
Share this answer
 
v2
tnitin55 wrote:
My problem is when go back all the data store in database but not displayed on the page and for that i have used session but it shows the same data that entered first to all the users


1. First of all, are you using Session or Application object for storing the data. AFAIK, Session object will not be shared between two users. Application object is common for all object. Until you use Session object, you will not have any problem.

2. There could be another reason for your problem. Make sure you don't use static variables to maintain the Session object locally.
 
Share this answer
 
v2

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