?? addtocart.aspx
字號:
<%@ Page Language="vb" %>
<script language="VB" runat="server">
'*******************************************************
'
' The Page_Load event on this page is used to add the
' identified product to the user's shopping cart, and then immediately
' redirect to the shoppingcart page (this avoids problems were a user hits
' "refresh" and accidentally adds another product to the cart)
'
' The product to add to the cart is specified using
' a querystring argument to the page.
'
' Other source code to examine:
' Conference.ShoppingCart.GetShoppingCartID() Method
' Conference.ShoppingCart.AddItem() Method
'
'*******************************************************
Sub Page_Load(sender As Object, e As EventArgs)
If Request.Params("ProductID") <> Nothing Then
Dim cart As New Conference.ShoppingCartDB
' Obtain current user's shopping cart ID
Dim cartID as String = cart.GetShoppingCartId()
' Add Product Item to Cart
cart.AddItem(cartId, CInt(Request.Params("ProductID")), 1)
End If
Page.Navigate("ShoppingCart.aspx")
End Sub
</script>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -