SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this datapager and I want to get the current page. I checked out the properties of about everything and the MSDN documentation and I still did not find anything useful to get the current page. Can anyone help?

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


<asp:NextPreviousPagerField ButtonType="Link" FirstPageText="<<" PreviousPageText="<" ShowFirstPageButton="true" ShowNextPageButton="false" />

<asp:NumericPagerField ButtonCount="3" />

<asp:NextPreviousPagerField ButtonType="Link" LastPageText=">>" NextPageText=">" ShowLastPageButton="true" ShowPreviousPageButton="false" />


share|improve this question
up vote 1 down vote accepted

This isn't a SharePoint question, however here is the answer:

That data isn't actual stored as part of the Data Pager control. It is done with the ListView or GridView. (See for some more information on that).

Basically you can use the StartRowIndex property of the ListView/GridView to determine where you are. You may want to tweak the math a bit for your needs, but if you divide the StartRowIndex by the page size and then either round up to one, if less than one, or round down to the nearest whole number, you should end up with the page you are on.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.