Ch16-06-03.aspx DataGrid控件的分页显示
'Dim SortExpression As String = "UserAccount"
Function GetDataSource() As ICollection
Dim OBJDataSet As DataSet = New DataSet()
Dim tSQL As String = "Select * From UserDatas"
GetDataSet(OBJDataSet, tSQL)
DataGrid1.DataSource = OBJDataSet.Tables("UserDatas").DefaultView
DataGrid1.DataBind()
End Function
Sub Page_Load(sender As Object, e As EventArgs)
If Not IsPostBack Then
GetDataSource()
End If
End Sub
Sub Page_Change(sender As Object, e As DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
GetDataSource()
End Sub
DataGrid控件的分页显示
AllowPaging="True"
PageSize = "2"
PagerStyle-Mode = "NumericPages"
PagerStyle-HorizontalAlign="Center"
OnPageIndexChanged = "Page_Change" />