System.Web.UI.WebControls Namespace DetailsView Class
.NET Framework version 2.0
Sets or retrieves the index of the currently displayed page.
Script |
DetailsView.PageIndex [ = intIndex ] |
This property can only be used programmatically; it cannot be set when declaring the control.
intIndex |
The index of the page currently displayed. |
The property is read/write with a default value of 0 ( zero ).
Use this property to determine the currently displayed page in the DetailsView control when paging is enabled. This property is also used to programmatically control which page is displayed.
To display a specific page, set this property to the page index you want to display and then rebind the data to the DetailsView control.
NOTE: The PageIndex property is zero based.
To determine the total number of items in the data source, use the PageCount property.
The following example demonstrates how to use the PageIndex property to determine the currently displayed page in a DetailsView control .
<p>Viewing Page <%= empsView.PageIndex + 1 %> of <%= empsView.PageCount %></p>
Show me
DetailsView Members AllowPaging PageCount