System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Returns the total number of pages required to display all the records of the data source in a FormView control.
Script |
FormView.PageCount = intCount |
This property can only be used programmatically; it cannot be set when declaring the control.
intCount |
Integer specifying the total number of pages required to display the rows in the FormView control. |
The property is read only with no default value.
Use this property to programmatically determine the number of pages required to display the rows in the FormView control. This property is only used when the AllowPaging property is set to true.
NOTE: Because the FormView control displays only one record at a time, this value corresponds to the total number of pages required to display every record in the data source. This value is not accurate until after data-binding occurs.
To determine the index of the current record from the underlying data source, use the PageIndex property.
The following example demonstrates how to use the PageCount property to determine the number of pages required to display the rows in the FormView control.
<p>Viewing Page <%= empsView.PageIndex + 1 %> of <%= empsView.PageCount %></p>
Show me
FormView Members AllowPaging PageIndex PageIndexChanging Specifying Paging Behavior in a FormView Control