This documentation is archived and is not being maintained.

TemplatePagerField::PagerTemplate Property

Gets or sets the custom content for the pager field in a DataPager control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)

[TemplateContainerAttribute(typeof(DataPagerFieldItem), BindingDirection::TwoWay)]
[BrowsableAttribute(false)]
[PersistenceModeAttribute(PersistenceMode::InnerProperty)]
public:
virtual property ITemplate^ PagerTemplate {
	ITemplate^ get ();
	void set (ITemplate^ value);
}

Property Value

Type: System.Web.UI::ITemplate
A template object that contains the custom content for the pager field in a DataPager control. The default is nullptr, which indicates that this property is not set.

Use the PagerTemplate property to define a custom user interface (UI) for paging data. The PagerTemplate template usually contains navigation controls to page through data. It can also be used to display information about the underlying data source, such as the total number of records or the current page number.

To create a custom template declaratively, put a PagerTemplate element inside the TemplatePagerField object. You can then add the contents to the PagerTemplate element.

You can reference the DataPager control in binding expressions in the PagerTemplate template by using the Container property. This property provides access to the properties of the DataPager control, which includes the StartRowIndex, MaximumRows, and TotalRowCount properties.

The following example shows how to add controls to the PagerTemplate template that access properties of the DataPager control.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Show: