searchresultcontrol.ascx.vb

来自「C#语言制作asp.net网上商店的」· VB 代码 · 共 32 行

VB
32
字号
Imports NetShopForge.Library.Product
Partial Class Shop_Search_Controls_SearchResultControl
    Inherits System.Web.UI.UserControl
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then

            BindData()
        End If
    End Sub

    Private Sub BindData()
        Dim iCount As Integer
        dlSearchResult.DataSource = ProductController.GetProductList(Pager.PageSize, Pager.CurrentPageIndex, iCount)
        Pager.RecordCount = iCount
        dlSearchResult.DataBind()
        Pager.CustomInfoHTML = "记录总数:" + Pager.RecordCount.ToString()
        Pager.CustomInfoHTML += " 总页数:" + Pager.PageCount.ToString()
        Pager.CustomInfoHTML += " 当前页:" + Pager.CurrentPageIndex.ToString()

    End Sub


    Protected Sub ChangePage(ByVal src As Object, ByVal e As EventArgs) Handles Pager.PageChanged
        Dim startTime As System.DateTime = System.DateTime.Now

        BindData()
        Dim endTime As System.DateTime = System.DateTime.Now
        Dim ts As System.TimeSpan = endTime - startTime
        Label1.Text = "页面执行时间:" & ts.Milliseconds & " 毫秒"
    End Sub
End Class

⌨️ 快捷键说明

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