Answer: 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">
<Fields>
<asp:NumericPagerField ButtonCount="5" />
</Fields>
</asp:DataPager>
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