After learning about the custom controls, I developed my own paging controls by referring to aspnetpager. Compared with aspnetpager, it has many functions, but I personally feel that it has too many code.
Interface:
Usage:
<% @ Register assembly = "YSM. AspNetPager" namespace = "YSM. AspNetPager" tagprefix = "PC3" %>
Page registration control, which can also be configured in web. config
1. ajax UpdatePanel paging: place the control in UpdatePanel (url rewriting and url parameter paging cannot be enabled, that is, jump to the page)
<PC3: ysmPager ID = "YsmPager1" runat = "server" PageSize = "10" onpagechanged = "canonical" CssClass = "yahoo" CurrentPageButtonClass = "current" DisabledButtonClass = "disabled"> </cached: ysmPager>
CssClass: sets the div style of the control; CurrentPageButtonClass: sets the style of the current index page; DisabledButtonClass: sets the disabled style when the previous page button is enabled.
2. You need to set the UrlRewriting attribute to true for url rewriting pages, and the UrlRewritePattern attribute for Url rewriting rules.
<PC3: YsmPager ID = "YsmPager2" runat = "server" PageSize = "10" UrlRewriting = "true" UrlRewritePattern = "success"> </PC3: YsmPager>
When multiple parameters in index-000000000-0000cid).html are used, the page is automatically formatted using {0}. Other parameters are configured using [Your parameter name.
Attribute introduction:
PageSize: Get or set the number of records displayed on each page
CurrentPageIndex: gets or sets the index of the current page.
RecordCount: Get or set the total number of records (you must set the value to generate a paging link)
PageCount: get the total number of pages. This attribute is only get
UrlPaging: whether to enable pagination for Url parameter passing (false by default)
UrlPageIndexName: "Get or set the parameter name (default page) of the page index to be passed in the Url when the url paging mode is enabled ).
UrlRewriting: Indicates whether to enable Url rewriting. If this parameter is set to true, UrlPaging is set to true (false by default)
UrlRewritePattern: Url rewriting format (null by default)
CurrentPageButtonClass: button style on the current page (null by default)
DisabledButtonClass: sets the button style for disabling the next page of the previous page (null by default)
FirstPageText: Set the text of the button on the first page (default: 1)
LastPageText: Set the text of the last night button (default value of PageCount)
ShowJumpBox: Set whether to display the jump box (displayed by default)
Download controls