Pages of DataPager and VSDataPager in
The paging function of Microsoft DataPager is very powerful. Do not set database stored procedures. You only need to add a DataPager control and associate it with the control to be paged. A simple setting can have a good paging effect. Of course, the ideal results should be processed at the front-end and back-end.
DataPager display mode in winform:
Styles in webForm are controlled by TemplatePagerField, NextPreviousPagerField, and NumericPagerField.
By setting the cooperation of the preceding controls, you can also achieve the effect of winForm. The most important of the three controls is the TemplatePagerField control.
The following describes how to set the TemplatePagerField control:
1 <%@ Page language="VB" %> 2 3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 5 6 <script runat="server"> 7 8 Protected Sub TemplatePagerField_OnPagerCommand(ByVal sender As Object, _ 9 ByVal e As DataPagerCommandEventArgs) 10 11 ' Check which button raised the event 12 Select Case e.CommandName 13 14 Case "Next" 15 Dim newIndex As Integer = e.Item.Pager.StartRowIndex + e.Item.Pager.PageSize 16 If newIndex <= e.TotalRowCount Then 17 e.NewStartRowIndex = newIndex 18 e.NewMaximumRows = e.Item.Pager.MaximumRows 19 End If 20 21 Case "Previous" 22 e.NewStartRowIndex = e.Item.Pager.StartRowIndex - e.Item.Pager.PageSize 23 e.NewMaximumRows = e.Item.Pager.MaximumRows 24 25 Case "First" 26 e.NewStartRowIndex = 0 27 e.NewMaximumRows = e.Item.Pager.MaximumRows 28 29 End Select 30 31 End Sub 32 33 </script> 34 35
Reference: https://msdn.microsoft.com/zh-SG/library/system.web.ui.webcontrols.templatepagerfield.pagercommand.aspx
Https://msdn.microsoft.com/zh-cn/library/system.windows.controls.datapager (v = VS.95). aspx