How to convert "shopping cart" Chapter 12 from ASP 1.1, to ASP 2.0 using VB.Net 2005

Hi All.

In reference to the first edition of “Build your own ASP website” in Chapter 12, there is a “Shopping Cart” application which uses ASP 1.1. Does anyone know how to convert the codes to (ASP 2.0) using VB.Net 2005?

I’ve been trying to convert DataGrid Codes to GridView Codes, of no avail.

Any help on that is greatly appreciated.

Shawn

Thank you for your reply. I have pasted the following parts that I have problems converting from ASP 1.1, to ASP 2.0 or above.


Sub AddToCart(s As Object, e As DataListCommandEventArgs)
pnlShowItems.Visible = False
pnlShowCart.Visible = True

Dim ItemID As Integer = dlItems.DataKeys(e.Item.ItemIndex)
Dim objItemInfo As DataSet = FindItem(ItemID)

Dim blnMatch As Boolean = False
For Each objDR In objCartDT.Rows
	If objDR("ItemID") = ItemID Then
		objDR("Quantity") += 1
		blnMatch = True
		Exit For
	End If
Next

End Sub


The others involve the Edit, Cancel, Update, and Delete, as follows.


Sub dgCart_Edit(s As Object, e As DataGridCommandEventArgs)
dgCart.EditItemIndex = e.Item.ItemIndex

dgCart.DataSource = objCartDT
dgCart.DataBind()

End Sub


Sub dgCart_Cancel(s As Object, e As DataGridCommandEventArgs)
dgCart.EditItemIndex = -1

dgCart.DataSource = objCartDT
dgCart.DataBind()

End Sub


Sub dgCart_Update(s As Object, 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
		objDR("Quantity") = Int32.Parse(txtQuantity.Text)
		Exit For
	End If
Next

lblTotal.Text = "$" & GetItemTotal()
dgCart.EditItemIndex = -1

dgCart.DataSource = objCartDT
dgCart.DataBind()

End Sub


Sub dgCart_Delete(s As Object, e As DataGridCommandEventArgs)
objCartDT.Rows(e.Item.ItemIndex).Delete()

dgCart.DataSource = objCartDT
dgCart.DataBind()

lblTotal.Text = "$" & GetItemTotal()

End Sub


I would greatly appreciate you taking time to convert this.

Regards,
Shawn

If you can post some code and what you have tried, we can help