[Asp.net] AspNetPager paging component

Source: Internet
Author: User

The official website also provides a storage process generation tool. You can write it by yourself here. By the way, you can learn the syntax of the stored procedure: Copy code 1 create proc Paged 2 @ pageIndex INT, 3 @ pageCount int output, 4 @ pageSize INT 5 AS 6 DECLARE @ count INT 7 SELECT @ count = COUNT (*) FROM dbo. student 8 SET @ pageCount = CEILING (@ count * 1.0/@ pageSize) 9 SELECT 10*11 FROM 12 (SELECT ROW_NUMBER () OVER (order by dbo. student. stuId) AS tempId, * FROM dbo. student) AS stu13 WHERE tempId >=@ pageSize * (@ pageIndex-1) + 1 AND tempId <= @ pageIndex * @ pageSize copy Code introduce components in the page: <% @ Register Assembly = "AspNetPager" Namespace = "Wuqi. webdiyer "TagPrefix =" webdiyer "%> paging style 1: Copy code 1 from the last page of the previous page of the homepage <webdiyer: aspNetPager ID = "AspNetPager1" runat = "server" 2 CustomInfoHTML = "% PageCount % page in total, currently % CurrentPageIndex % PAGE, % PageSize % per page, % RecordCount % Total "3 FirstPageText =" Homepage "4 LastPageText =" last page "5 NextPageText =" next page "6 PageIndexBoxType =" TextBox "7 PrevPageText =" Previous Page "8 ShowCustomInfoSection = ""Left" 9 ShowPageIndex = "False" 10 ShowPageIndexBox = "Always" 11 SubmitButtonText = "Go" 12 SubmitButtonClass = "right_d_btn" 13 placement = "page" 14 TextBeforePageIndexBox = "Go" 15 OnPageChanging = "AspNetPager1_PageChanging" 16 AlwaysShow = "True" 17 PageSize = "10" 18 ShowMoreButtons = "false" 19 HorizontalAlign = "Center"> 20 </webdiyer: aspNetPager> result 2: Code 1 <form id = "form1" runat = "server"> 2 <asp: gridview runat = "server" ID = "gridStudent"> </asp: gridview> 3 <div> 4 <% -- paging style 2 default mode 1 2 3 4 5 6 7... -- %> 5 6 <webdiyer: AspNetPager ID = "AspNetPager1" runat = "server" PageSize = "5" 7 OnPageChanging = "AspNetPager1_PageChanging"> 8 </webdiyer: aspNetPager> 9 </div> 10 </form>

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.