Using Static Variables for storing Shopping Basket Items

Joined
May 16, 2009
Messages
1
Reaction score
0
Hi..

I am wrking on Asp.net 3.5, C#... This is regarding session management. now i am into commerce website development. In this website, i am using one shopping cart. when the user clicks on item, am storing it in local STATIC global variable. I am not using session here.
If i use local variable(non-static) , i am not getting those values correctly across different scopes of .cs file.. so i decided to use STATIC variable..it works fine..
bt i am afraid, tht when concurrent users accessing the same page, what will happen to those static variables.. is this user specific or remains same for all the users.. if it remains same for all the users, am into deep trouble here.. please help me out.. am very new to sessions and shopping baskets.. is there any way out to come out of this problem without using sessions n sticking with those local staic variables... coz lot of coding already done..recoding will cost me dear..
 
Joined
Mar 4, 2009
Messages
17
Reaction score
0
Yes you will face concureency problem due to the static vriable. The another way is you can use view state. But view state has another implication. So better use session. I think so.

REGARDS
shawpnendu.blogspot.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top