Dim e As RequestEventArgs = Args(0)
Dim wb As New WeUI
Dim page As Integer = 0 '默认page为0,显示第一页
Dim pageRows As Integer = 15 '每页10行
If e.GetValues.ContainsKey("page") Then '如果地址中有page参数
Integer.TryParse(e.GetValues("page"), page) '提取page参数
End If
Dim StartRow As Integer = page * pageRows '此页第一行
Dim EndRow As Integer = (page + 1) * pageRows-1 '此页最后一行
Dim lst As List(of DataRow) = DataTables("村数据表").Select("","") '按日期顺序显示
If StartRow > lst.Count -1 Then
e.WriteString("已经是最后一页!")
Return""
End If
EndRow = Math.Min(EndRow, lst.Count - 1) '这是必须的
With wb.AddTable("","Table1")
.Alternate = 3
Dim nms() As String = {"县级名称","乡镇名称","行政村名","备注"}
.Head.AddRow(nms)
For r As Integer = StartRow To EndRow
For Each nm As String In nms
With .Body.AddRow( lst(r)(nm))
End With
Next
Next
End With
With wb.AddButtonGroup("","btg2", False)
If page > 0 Then
.Add("btnPrev", "上一页","","List.htm?page=" & page - 1)
End If
If Endrow < lst.Count -1 Then
.Add("btnNext", "下一页","","List.htm?page=" & page + 1)
End If
End With
e.WriteString(wb.Build)
此主题相关图片如下:11111.jpg