Using cookies

J

Jon Cosby

I'm trying to use a cookie to track the customer's running total.

Private Sub dgProds_SelectedIndexChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles dgProds.SelectedIndexChanged
...

If Request.Cookies("shopping") Is Nothing Then
count = 0
price = 0
Else
count = CInt(Response.Cookies("shopping")("ItemCount"))
price = CSng(Response.Cookies("shopping")("SubTotal"))
End If

count += 1
price += CSng(dgProds.Items.Item(index).Cells(3).Text)

Response.Cookies("shopping")("SubTotal") = price.ToString()

...

"dgProds" is a Datagrid. The subtotal is always the price of the last
selected item. Do I have to use a session variable for this?
 
J

Joe Molloy

I don't mean to be rude but it would really help if you asked a question
here...
 

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

Similar Threads

Using Cookies 0
Cookies Count 2
Cookies 1
Cookies 1
cookies 1
No-Postback Reload Causing Duplicates :( 0
Problem with accessing cookies? 3
help with using shopping cart totals 7

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top