Controls You Can Use on Web Forms ASP.NET Data Controls FormView Control
The FormView Web server control enables paging thru the records in the data source using any of the following methods:
- Default paging using built-in paging controls
- Default paging using custom navigation controls
- Custom paging
- Set the control’s AllowPaging property to true.
<asp:formview id="productSpecs" runat="server"
datasourceid="products"
allowpaging=true
...
>
or simply
<asp:formview id="productSpecs" runat="server"
datasourceid="products"
allowpaging
...
>
The FormView control includes properties for customizing the default pager style.
- Within the FormView declaration, declare a <PagerSettings> element.
- Within the PagerSettings element, define each of the properties you intend to customize. For syntax, see FormView Control Syntax.
<pagersettings
mode="nextprevious"
nextpagetext="Next"
previouspagetext="Back"
position="top"
pagebuttoncount=10 />
- Also within the FormView declaration, declare a <PagerStyle> element.
- Within the PagerStyle element, define each of the properties you intend to customize. For syntax, see FormView Control Syntax.
<pagerstyle
backcolor="steelblue"
forecolor="beige"
horizontalalign="right" />
Specifying Row Format in a FormView Control