asp.net-practical tips for the discussion of page-diving

Source: Internet
Author: User
To make a paging effect there are only a few directions to start with, from the data source, from the server, or from the client. No matter how you do it can not jump out of these three places (in fact, the development of B/s structure is in these three places to make a fuss, but a little change only).

First, let's start with the data source. The idea of a data source as a paging is, of course, T-SQL. What stored procedures, views, special functions (which, of course, refer only to my familiar ms). All the SQL knowledge you can use goes up. Concrete implementation will not say, it easy. The code section basically has nothing, just change the T-SQL statement every time. Bad is too limited by the database, the program a little bit of change, all about the place to change the SQL, and some even change the structure of the database. No solid knowledge of the database is absolutely impossible.

Server-side paging may be the most common approach for connoisseurs. Because there are packaged data-bound controls Ah! You can use it if you bring it. But, then, Microsoft is a big guy, and everything is prudent. Consider both the rookie and the Dinosaur. If you are a rookie, use the GridView, built-in pagination so that you can hardly write code to achieve. But if you are a dinosaur then use ListView or DataList control, absolutely can let your technology play incisively and vividly. To give these people a step, Microsoft has developed the DataPager control. He seems to only recognize the IPageableItemContainer interface. Then there is the Aspnetpager control, which gives all data-bound controls another chance to page out. However, unlike DataPager, Aspnetpager only aspnetpager the UI portion of the page and cannot complete the paging function of the data alone. In fact, we will certainly ask, why can't we do our own pagination control? This doesn't seem to be Microsoft's principle, is it? Haha, don't misunderstand Microsoft. In fact, there is already this method, but few people. This is PagedDataSource. He doesn't have a UI, and all of Microsoft's paging controls are extended to him, including the earliest GridView. With him, we can do our own paging control. If the combination of Aspnetpager and pageddatasource, it would be doubled.

Tell me more about client pagination. In the past, the client made paging is undoubtedly a fat client. Save all the data to the page and use JS to control the display order. A small amount of data can be endured, with more data than murder. However, since the advent of Ajax, this phenomenon has been changed. Although it is also indispensable to interact with the server, but always better than waiting? In this regard. NET also performed well. With UpdatePanel, everything is in the silence.
The above three directions can be very good to complete the paging function, but who good who is bad is not my one can decide, but also to see personal preferences. However, one person's principle can not be ignored, that is "Avenue to Jane, enough". Believe that everyone has their own experience.

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.