System.Web.UI.WebControls Namespace FormView Class
.NET Framework version 2.0
Specifies the template to use for the pager row in a FormView control.
<asp:formview ... >
<pagertemplate>
... template definition here
</pagertemplate>
</asp:formview>
An ITemplate interface that defines how the pager row of a FormView control is rendered.
The property is read/write with no default value.
The PagerTemplate describes the layout of elements to render in the pager section of a FormView control.
When the paging feature is enabled ( AllowPaging is set to true ), a pager row is displayed in the FormView that contains the controls to enable users to navigate to the different pages in the control. The PagerTemplate enables customizing this paging interface.
NOTE: When the PagerTemplate property is set, it overrides the built-in pager row interface.
To specify a template for the pager section of a FormView, declare a <PagerTemplate> element between the opening and closing tags of the control. You can then list the contents of the template between the opening and closing <PagerTemplate> ... </PagerTemplate>
tags.
In addition, the appearance for this template can be set using the PagerStyle property.
Typically, button controls are added to the pager template to perform the paging operations. The FormView control performs a paging operation when a button control with its CommandName property set to Page is clicked. The button's CommandArgument property determines the type of paging operation to perform. The following table lists the command argument values supported by the FormView control.
CommandArgument |
Description |
Next |
Navigates to the next page. |
Prev |
Navigates to the previous page. |
First |
Navigates to the first page. |
Last |
Navigates to the last page. |
Integer value |
Navigates to the specified page number. |
NOTE: The PagerTemplate item cannot be data bound.
FormView Members BottomPagerRow PagerStyle TopPagerRow Specifying Paging Behavior in a FormView Control