About ASP.net Custom Paging controls _ Practical Tips

Source: Internet
Author: User

These days to learn the next custom control, reference to the Aspnetpager developed its own paging control. The function is more than aspnetpager, but the individual feels his code is too much.

Interface:

Use:

<%@ Register assembly= "Ysm. Aspnetpager "Namespace=" Ysm. Aspnetpager "tagprefix=" CC1 "%>

Page registration controls, or you can configure the in Web.config

1.ajax UpdatePanel the control into the UpdatePanel (you cannot enable URL rewriting and URL parameter paging, that is, jump page)

<cc1:ysmpager id= "YsmPager1" runat= "pagesize=" onpagechanged= "ysmpager1_pagechanged" cssclass= "Yahoo" currentpagebuttonclass= "Current" disabledbuttonclass= "disabled" ></cc1:YsmPager>

CssClass: Sets the style of the control div; Currentpagebuttonclass: Sets the style of the current index page; Disabledbuttonclass: Sets the disabled style when the next page button is enabled.

2.url overriding paging requires setting the Urlrewriting property to the True,url override Rule Urlrewritepattern property.

<cc1:ysmpager id= "YsmPager2" runat= "Server" pagesize= "" urlrewriting= "true" urlrewritepattern= "Index-{0}-[cid" . html ></cc1:YsmPager>

index-{0}-[cid].html multiple parameters using the page is automatically formatted with {0}, and other parameters are configured using [your parameter name].

Property Description:

PageSize: Gets or sets the number of records to display per page

CurrentPageIndex: Gets or sets the current page index

RecordCount: Gets or sets the total number of records (you must set a value in order to have a raw page link)

PageCount: Gets the total number of pages, this property is only get

urlpaging: Enable URL pass-through paging (default false)

Urlpageindexname: Gets or sets the name of the parameter (the default page) that represents the index of the page to pass in the URL when URL paging is enabled.

Urlrewriting: URL rewriting is enabled, and Urlpaging is set to True when True (default false)

Urlrewritepattern:url rewrite format (default null)

Currentpagebuttonclass: Current page button style (default null)

Disabledbuttonclass: Set Disable previous next page button style (default null)

Firstpagetext: Sets the text of the first page button (default 1)

Lastpagetext: Sets the text of the last night button (the default PageCount value)

Showjumpbox: Set whether to display a jump box (default display)

Download Control

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.