Introduction to the use of the Asp.net urlpager Control

Source: Internet
Author: User
Introduction to using the ...asp.net urlpager control in the editor
1. Introduce urlpager. dll
2. Add in Web. config

3. register the route (in the Global File)
Using system. Web. Routing; // introduce the namespace
Call methods in application_start
Void application_start (Object sender, eventargs E)
{
Registerroutes (routetable. routes );
}
Compile a route Registration Method
Public static void registerroutes (routecollection routes)
{
Routes. mappageroute ("urlpagingrepeater ",
"{Controller}/{action}/Page _ {ID }",
"~ /Orderde. aspx ");

Routes. mappageroute ("urlpagingbasic ",
"Home/{pageindex }",
"~ /Default. aspx ");
}
4. mainly on the ASPX page
Introduce controls

Add controls

5. mainly in the CS File
Call the pagechanged event of the control to perform operations.
For example, Infos = orderinfo. searchorder (this. pager1.startrecordindex, this. pager1.endrecordindex );
6. At the beginning, you must write the stored procedure first.
Alter procedure [DBO]. [getorderpager]
@ Startindex int,
@ Endindex int
As
Begin
With orderlist (
Select row_number () over (order by orderid DESC) as row, * from [order]. orderinfo
Where 1 = 1
)
Select * From orderlist
Where row between @ startindex and @ endindex
End

Complete!

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.