Idea: Expand htmlhelper to load the mvc3 template page or the ascx user control in MVC2 to customize the paging layout and style.
Implementation: The pagemodel page type includes:
Pageindex page index
Pagetext page display text
Pager paging controls
The pagertemp paging control loads the cshtml or ascx name.
Pagerid: the ID of the paging control.
Pagination of pagershow
Pagesize: number of records displayed per page
Curpage index of the current page
The minimum number of pagenum pages displayed[Offset]
Total totalpage pages
Total totalsize Record Data
List <pagemodel> page number list
Controllername controller name
Actionname action name
Pagehelper pagination control generation class, extended htmlhelper used to create pagination Control
Public static mvchtmlstring Pager (this htmlhelper helper,
String pagerid, // Paging Control ID
Int curpage, // Current page number
Int totalsize, // Total number of records
String pagertemp = "_ pagertemp ", // Pagination control Template
Int pagesize = 10, // 10 entries per page
Int pagenum = 5 // Number of displayed page numbers
){
// Create a paging Control
}
_ Pagetemp: page control display template
Similar blog garden effects:
CodeClick to download