asp.net.ph

DetailsView.PageCount Property

System.Web.UI.WebControls Namespace   DetailsView Class


.NET Framework version 2.0

Returns the total number of pages required to display all the records of the data source in a DetailsView control.

Syntax


Script DetailsView.PageCount = intCount

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value


intCount Integer specifying the total number of pages required to display the rows in the DetailsView control.

The property is read only with no default value.

Remarks

Use this property to programmatically determine the number of pages required to display the rows in the DetailsView control. This property is only used when the AllowPaging property is set to true.

NOTE: Because the DetailsView 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.

Example

The following example demonstrates how to use the PageCount property to determine the number of pages required to display the rows in the DetailsView control.

<p>Viewing Page <%= empsView.PageIndex + 1 %> of <%= empsView.PageCount %></p>

 Show me 

See Also

DetailsView Members   AllowPaging   PageIndex   PageIndexChanging Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph