Created a shopping cart in a Session ASP.Net how to move it to another page?

shopping cart systems
Juan asked:


My professor gave us a code for a shopping cart that he created in a Session but I was wondering how can I make the data of the shopping cart to show on another page called (CheckOut.aspx), I plan the user to click on a button and be directed to this page to complete the purchase.
Code on the first page : Server.Transfer(CheckOut.aspx)
Code on the CheckOut.aspx page: Response.Write(Request.Form(Session(Cart))) – but it doesn’t work.
Shopping cart:
Function makeCart()
‘make a table in memory that will represent the cart
objDT = New System.Data.DataTable(Cart)

objDT.Columns.Add(ID, GetType(Integer))
objDT.Columns(ID).AutoIncrement = True
objDT.Columns(ID).AutoIncrementSeed = 1
objDT.Columns.Add(Quantity, GetType(Integer))
objDT.Columns.Add(Product, GetType(String))
objDT.Columns.Add(Cost, GeType(Decimal))
‘put the cart in the session object
Session(Cart) = objDT

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Webnews
  • MisterWong
  • Y!GG

You must be logged in to post a comment.