469,344 Members | 6,476 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

shopping cart problem

i just finished creating an asp.net application named booksApp.

during the testing phase uploaded live ( ex: www.bookies.com) , i tried to
purchase something and add it to my shopping cart.

then, i tried opening the application on a different client computer. I just
randomly checked the shopping cart and there i found the same items i added
to my cart on the first computer.

all i did using to add to my cart was session("cart").

how can i just save the contents of the current cart to the current machine
being used?

thanks a million guys!

Jan 29 '07 #1
5 1267
all i did using to add to my cart was session("cart").

You must have done something different, can you post some relevant code?
You're not using shared (vb) / static (c#) variables anywhere are you?
Jan 29 '07 #2
"ChiWhiteSox" <Ch*********@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.com...
>i just finished creating an asp.net application named booksApp.
Yesterday, you'd just finished creating an application called 'teddybears' -
you are a busy person, aren't you...? :-)

Which application will you just have finished tomorrow, I wonder...?
Jan 29 '07 #3
"Aidy" <ai**@noemail.xxxa.comwrote in message
news:rY*********************@bt.com...
You're not using shared (vb) / static (c#) variables anywhere are you?
He certainly is - see his virtually identical post from yesterday - only the
names have been changed to protect the innocent, etc...;-)
Jan 29 '07 #4
hi, thats the same guy :)

i changed it coz its hard to find my old post ...

anyways, heres the code (again)

Dim ala As New ShoppingCart

If Not IsNothing(Session("shoppingcart")) Then
ala = Session("shoppingcart")
End If

Dim objCartItem As New cartitem
Dim intItems As Integer

objCartItem.itemcode = seqid
objCartItem.itemname = seqname
objCartItem.qty = Qty
objCartItem.ddate = eventDate
objCartItem.unitprice = unit
objCartItem.total = objCartItem.unitprice * objCartItem.qty

ala.addCartItem(objCartItem)
Session("cartcount") = ala.CountItemsinCart.ToString
Session("shoppingcart") = ala

----------------------------------------------------------
on Global.vb class:
----------------------------------------------------------
Public _ItemsinCart As New Collections.ArrayList

----------------------------------------------------------
on a separate class called ShoppingCart.vb :
----------------------------------------------------------
Public Structure cartitem

Public itemcode As String
Public itemname As String
Public ddate As DateTime
Public unitprice As Decimal
Public total As Decimal
Public coupon As String
Public grandtotal As Decimal
Public qty As Long
Public schedulecode As String
End Structure
Public Sub addCartItem(ByVal item As cartitem)
If Not isItemExists(item) Then
_ItemsinCart.Add(item)
End If
End Sub
"Mark Rae" wrote:
"ChiWhiteSox" <Ch*********@discussions.microsoft.comwrote in message
news:67**********************************@microsof t.com...
i just finished creating an asp.net application named booksApp.

Yesterday, you'd just finished creating an application called 'teddybears' -
you are a busy person, aren't you...? :-)

Which application will you just have finished tomorrow, I wonder...?
Jan 29 '07 #5
"ChiWhiteSox" <Ch*********@discussions.microsoft.comwrote in message
news:58**********************************@microsof t.com...
i changed it coz its hard to find my old post ...
Er...OK

I have already replied to this.
Jan 29 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Don Grover | last post: by
1 post views Thread by madison | last post: by
1 post views Thread by Jia Sun | last post: by
1 post views Thread by Adil Akram | last post: by
2 posts views Thread by G.E.M.P | last post: by
1 post views Thread by jecha | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.