System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Sets or retrieves the index of the currently displayed page.
Script |
FormView.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 FormView 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 FormView 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 FormView control .
<p>Viewing Page <%= empsView.PageIndex + 1 %> of <%= empsView.PageCount %></p>
Show me
FormView Members AllowPaging PageCount Specifying Paging Behavior in a FormView Control