Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET session
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 27-Feb-12 23:09pm
Edited 28-Feb-12 0:42am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello,
 
I know 2 ways:
 
1. use GUID as Session and store it in database as a code
 
For example:
 
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:
 
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 Wink | ;)
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
v2

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

  Print Answers RSS
0 George Jonsson 175
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 28 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100