What is DataPager control, describe it?

 Posted by Tripati_tutu on 10/15/2010 | Category: ASP.NET Interview questions | Views: 2990 | Points: 40

The DataPager serves as an external control to provide paging features. The DataPager class is used to page data and to display navigation controls for data-bound controls that implements the IPageableItemContainer interface and also associates the DataPager control with the data bound control. It provides a navigation bar on top or on bottom of the page (or both) to navigate to other pages according to the user's requirement. Below there is a description about different page field types.

NextPreviousPagerField -Enables users to navigate through pages one page at a time, or to jump to the first or last page.

NumericPagerField - Enables users to select a page by page number.

TemplatePagerField - Enables you to create a custom paging UI.

Below is the sample code to create a datapager:

<asp: datapager PageSize="10" ID="DataPager1" runat="server" PagedControlID="ListView1">

<asp:nextpreviouspagerfield ButtonType="Link" ShowPreviousPageButton="True" ShowNextPageButton="False"/>
<asp:numericpagerfield />
<asp:nextpreviouspagerfield ButtonType="Link" ShowPreviousPageButton="False" ShowNextPageButton="True" />

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response