Simple paging without style

Source: Internet
Author: User

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>

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.