product.aspx.vb

来自「Visual Basic.NET控件时尚编程百例」· VB 代码 · 共 38 行

VB
38
字号
Public Class Product
    Inherits System.Web.UI.Page
    Protected WithEvents lblSectionTitle As System.Web.UI.WebControls.Label
    Protected WithEvents dlstProducts As System.Web.UI.WebControls.DataList

#Region " Web 窗体设计器生成的代码 "

    '该调用是 Web 窗体设计器所必需的。
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: 此方法调用是 Web 窗体设计器所必需的
        '不要使用代码编辑器修改它。
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles MyBase.Load
        '在此处放置初始化页的用户代码
        Dim strProductID As String = Request.QueryString("ProductID")
        Dim objCatalog As New StoreCommon.Services.Categories()
        Dim dsProducts As StoreCommon.dsProduct = _
        New StoreCommon.dsProduct()
        dsProducts = objCatalog.GetProduct(strProductID)
        dlstProducts.DataSource = dsProducts
        dlstProducts.DataBind()
        If dsProducts.Products.Count > 0 Then
            lblSectionTitle.Text = dsProducts.Products(0).ProductName
        End If

    End Sub

End Class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?