I'm overlooking the obvious again...
I've got a page for products. When I press 'add to cart' on that page, it updates a data table held in session and redirects to a 'my cart' page.
Here's the Load for the 'my cart'
VB Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load objCartDT = Session("Cart") If objCartDT Is Nothing Then lblNoItems.Text = "There are no items in your cart." Else lblTotal.Text = "Total: $" & GetItemTotal() dgCart.DataSource = Session("Cart") dgCart.DataBind() End If End Sub
If they want to change a quantity, I've got this sub on the page:
VB Code:
Sub dgCart_Update(ByVal s As Object, ByVal e As DataGridCommandEventArgs) Dim txtQuantity As TextBox Dim intCartID As Integer intCartID = dgCart.DataKeys(e.Item.ItemIndex) txtQuantity = e.Item.FindControl("txtQuantity") For Each objDR In objCartDT.Rows If objDR("CartID") = intCartID Then 'this validates true objDR("Quantity") = Int32.Parse(txtQuantity.Text) Exit For End If Next lblTotal.Text = "Total: $" & GetItemTotal() dgCart.EditItemIndex = -1 dgCart.DataSource = objCartDT dgCart.DataBind() End Sub
I don't throw any errors, but I don't update the cart either. Not exactly sure where I'm screwing this up....any help?
Thanks


. Not exactly sure where I'm screwing this up....any help?
Reply With Quote
