Only pagelist can be returned to call this page without reference. So I call pagelist for simple paging and simple style. Although no other style is fancy, it is easy to use, so remember it for future convenience.
Code (written in the location where paging is required)
1 <Div id = "pager"> 2 <div> 3 current @ (model. pagecount <model. pagenumber? 0: model. pagenumber) 4 pages @ model. pagecount page 5 @ if (model. haspreviouspage) 6 {7 @ HTML. actionlink ("<", "Index", new {pageindex = 1}) 8 @ HTML. raw ("") 9 @ HTML. actionlink ("<previous page", "Index", new {pageindex = model. pagenumber-1}) 10} 11 else12 {13: <14 @ HTML. raw ("") 15 @: <Previous Page 16 17} 18 @ HTML. raw ("") 19 @ if (model. hasnextpage) 20 {21 @ HTML. actionlink ("next page>", "Index", new {pageindex = model. pagenumber + 1}) 22 @ HTML. raw ("") 23 @ HTML. actionlink (">", "Index", new {pageindex = model. pagecount}) 24} 25 else26 {27 @: Next page> 28 @ HTML. raw ("") 29 >>30} 31 </div> 32 </div>