Paging is one of the most commonly used functions in Web applications. In ASP.NET, although it comes with a DataGrid (asp.net 1.1) and GridView (asp.net 2.0) controls that can be used for paging, its paging function does not Unsatisfactory, such as poor customizability, inability to implement paging function through Url, etc., and sometimes we need to paginate DataList, Repeater or even custom data binding controls. Manually writing paging code is not only technically difficult, the task is cumbersome, but also the code The reuse rate is extremely low, so paging has become one of the biggest headaches for many ASP.NET programmers.
In response to the shortcomings of ASP.NET paging controls, AspNetPager proposed a unique solution to the paging problem in ASP.NET, that is, the paging navigation function and the data display function are completely independent, and the user controls the acquisition and display of data. Therefore, it can be flexibly used wherever paging navigation functions need to be implemented, such as implementing paging for data-bound controls such as GridView, DataList, and Repeater, presenting custom paging data, and making image browsing programs, etc., because the AspNetPager control and data are Independent, so the data to be paged can come from any data source, such as SQL Server, Oracle, Access, mysql, DB2 and other databases as well as XML files, in-memory data or data in cache, file systems, etc.
AspNetPager version 7.2 released
The new attribute PagingButtonLayoutType can be used to set the layout mode of paging navigation elements (numeric page index, previous page, next page, first page and last page). The value of this attribute is a PagingButtonLayoutType enumeration. By setting this attribute to PagingButtonLayoutType.UnorderedList or PagingButtonLayoutType. Span allows these pagination navigation elements to be included between the and or and tags to facilitate the application of CSS styles to these pagination elements.
Added PagingButtonClass and PagingButtonStyle properties, which can set CSS styles for paging navigation buttons (numeric page index, previous page, next page, first page and last page) individually;
Newly added FirstLastButtonClass and FirstLastButtonStyle properties, you can set CSS styles for the homepage and last page paging navigation buttons separately. If this property is not set, but the values of the PagingButtonClass and PagingButtonStyle properties are specified, the homepage and last page button styles will use the PagingButtonClass and PagingButtonStyle properties. The style specified in;
Added NextPrevButtonClass and NextPrevButtonStyle properties, you can set CSS styles for the previous and next page paging navigation buttons separately. If this property is not set, but the values of the PagingButtonClass and PagingButtonStyle properties are specified, the previous and next page button styles will use PagingButtonClass and The style specified in the PagingButtonStyle property;
Added MoreButtonClass and MoreButtonStyle properties, you can set CSS styles for more pages (...) paging navigation buttons separately. If this property is not set, but the values of the PagingButtonClass and PagingButtonStyle properties are specified, the previous page and next page button styles will be Use the styles specified in the PagingButtonClass and PagingButtonStyle properties;
Added new attribute ShowMoreButtons, which can specify whether to display more page buttons;
The new attribute CurrentPageButtonPosition can be set to display the current page digital index in all digital page indexes after each paging. The attribute value is a PagingButtonPosition enumeration. The corresponding value and description are as follows
Beginning: The current page numeric index is always displayed at the front of all numeric page indexes;
End: The current page digital index is always displayed at the end of all digital page indexes;
Center: The current page digital index is always displayed in the middle of all digital page indexes;
Fixed: Default value, fixed;
The CssClass property of the control is only applied to the window element (div) of the control and will no longer be applied to subordinate paging elements;
The property CenterCurrentPageButton is abolished and can be replaced by the CurrentPageButtonPosition property;
Modify the CurrentPageIndexn property, allowing you to set the value of CurrentPageIndex programmatically anywhere in the program to dynamically specify the current page. Directly setting the value of this property will trigger the PageChanging and PageChanged events at the same time, achieving the same paging function as clicking the paging button;
Fixed the bug in version 7.1 that after setting the SubmitButtonImageUrl attribute, clicking the digital page index button in Postback paging mode did not trigger a paging event;
Fixed the bug that the client script cannot be registered if there is no server-side form control on the page when using Url paging. From version 7.2, if using Url paging and the ShowPageIndexBox property is not set to Never, the AspNetPager control must be placed between the tags , if Url paging is used and ShowPageIndexBox is Never, the server-side form control does not need to be used on the page.
Main functions of AspNetPager
1. Support paging through Url
In addition to providing the default PostBack paging method similar to DataGrid and GridView, AspNetPager also supports paging through Url. Like paging in most ASP programs, the Url paging method allows users to enter the corresponding address in the browser address bar. Directly entering the specified page also allows search engines to search the content of all paginated pages, so it has the advantages of being user-friendly and search engine-friendly. Regarding the differences between Url paging and PostBack paging methods, please refer to the comparison of Url and PostBack paging methods.
2. Support Url rewrite (UrlRewrite) function in Url paging mode
Url rewriting technology can make the Url displayed to the user different from the actual Url. Url rewriting technology is widely used in search engine optimization (SEO), redirecting page paths after website reorganization, and providing user-friendly Url. AspNetPager supports Url rewriting technology allows you to customize the Url format of paging navigation and implement Url rewriting;
3. Support the use of user-defined images as navigation elements
You can use custom image files as navigation elements for paging controls instead of just displaying text content.
4. Powerful and flexible, easy to use and highly customizable
All navigation elements of the AspNetPager paging control can be controlled individually by the user. Starting from version 6.0, AspNetPager supports the use of themes (Theme) and skins (Skin) to unify the overall style of the control. With the DataSource control in asp.net 2.0, AspNetPager only You only need to write a few lines of code, or even no code at all. You only need to set a few properties to implement the paging function.
5. Enhanced Visual Studio 2005/2008 design-time support
Enhanced design-time support makes controls more intuitive at design time, easier to use, and faster and more convenient to develop.
6. Compatible with browsers such as IE6.0+ and FireFox 1.5+
7. Rich and complete control documentation and sample projects
The complete help documentation and sample projects included with the control can help you get started quickly and become familiar with the use of the AspNetPager control. You can also solve problems encountered in the use of the control by leaving messages to the author and asking questions in the forum.