Created a shopping cart in a Session ASP.Net how to move it to another page?
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)
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








Recent Comments