What is the use of DataPager control?

 Posted by Raja on 3/23/2010 | Category: ASP.NET Interview questions | Views: 6515

DataPager control is the new control introduced in the ASP.NET 4.0. This control is used to do pagination in the Data controls like ListView Server control.

The typical syntax of DataPager control is

<asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="5" QueryStringField="pageid">

<asp:NumericPagerField ButtonCount="5" />

Where PagedControlID is the id of the Listview, PageSize is the number of records to be displayed in the page, QueryStringField is the querystring for the current page number.

The fields properties can be used to show how many pagination button you would like to have when asp.net creates the paging for your ListView control.

More about DataPager control can be found at http://www.dotnetfunda.com/articles/article122.aspx

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response