關於Asp.Net的分頁,網上已經有許多相對成熟的解決方案。但是不難看出,這些方案多數是 Asp.Net1.1 時期的產物。Asp.Net2.0 中,DataSource 控制項的出現大大簡化了 Web 程式的代碼量,但部分現有的分頁方案在使用DataSource控制項時是不適用的。
本文推薦的PagerDataSource控制項則是一個專門用於 Asp.Net2.0 的資料分頁控制項,以下是該控制項要簡單介紹(由於本人 E 文不佳,就不對原文進行翻譯了,以免用詞不當或曲解原意,倒不如大家自己看 E 文得好):
Most web applications need to show large quantities of data but usually we do not show all the information on a single web page. It is very common to show only a portion of the information in the current page and to allow the user to navigate to other portions of the data. Some of the controls ASP.NET 2.0 provides have integrated paging support, but it is not very customizable. Other ASP.NET controls just do not provide any paging support so the developer has to provide the user interface and code to add paging support.
The PagerDataSource control helps us to show only a portion of the data at a time. We have to provide the data to display to the PagerDataSource control and it will render the user interface to navigate to the different pages of our data. It will also provide paged data to the controls that we want. What is even better, we can add paging support with no code at all if we are using the data source controls introduced in ASP.NET 2.0. You will be amazed to see several synchronized pagers for the same control with no code at all!
Providing paged data to another control is not the only thing that the PagerDataSource does. The PagerDataSource also exposes rich design-time support, unlimited customization, better search engine positioning for web pages and much more! For more information take a look at the Features page.
官方首頁:http://www.manuelabadia.com/products/default.aspx