Open-source pager Page Control (MVC example)

Source: Internet
Author: User

Recently, MVC uses paging, and finds a good paging control on the Internet. Thanks for the hard work of the author.

Download Pager

This paging control is also supported by Asp.net. You need to check the author's homepage.

Webdiyer

View the page chart

This is the simplest. This control also provides self-input jump and supports the selection of drop-down pages. Of course, I only use the simplest one. If you need to change it, please try to change it.

Now, check the view.Code

 1   @ Using webdiyer. webcontrols. MVC  2 @ Model pagedlist <pagertest. Models. view_saleteachercours> 3   4   @{  5      6 Layout =Null  ;  7   }  8 <Table> 9 <Tr> 10 <TH> Course name </Th> 11 <TH> instructor name </Th> 12 </Tr> 13   @{  14       15       Foreach ( VaR Item In  Model)  16   {  17 <Tr> <TD> @ item. Name </TD> 18 <TD> @ item. Username </TD> 19 </Tr> 20   }  21   }  22 <Tr> 23 <TD> 24 @ Html. Pager (model, New Pageroptions {pageindexparametername = "  ID  "  })  25 </TD> 26 </Tr> 27 </Table> 28 <A> </a>

A simple O (∩ _ ∩) O is displayed.
Note that you need to use this control to define a pagedlist <> as shown in the first two rows.

@ Html. Pager (model,NewPageroptions {pageindexparametername ="ID"})
This directly generates pages, which is simple, fast, violent, and effective !!

Control:

1PublicActionresult index (Int?ID)2 {3Dbdatacontext DB =NewDbdatacontext ();4Pagedlist <view_saleteachercours> List = dB. view_saleteachercours.topagedlist (ID ??1,2);5 6ReturnView (list );7}

Just a few simple lines of data will pop up.

 

Well, it's simple, but I 'd like to share it with you in the simplest way.

 

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.