The Pager control supports several templates that allow you to modify the default presentation of the control. Each template in the control has default markup that is part of the Endeca.Web.UI.WebCon¬ trols assembly. You can override the default presentation as necessary by providing your own markup in the templates.
Description Template name
This template defines the page size choices available to the user. The default markup for the template is:
<ItemsPerPageChoiceTemplate>
<asp:LinkButton runat="server" CommandArgument="<%# ItemsPerPage¬ ChoiceTemplate Container.DataItem.ItemsPerPage %>" Command¬ Name="ChangeItemsPerPage" Visible='<%# !Container.DataItem.IsSelected %>'> <%# Container.DataItem.ItemsPerPage %></asp:LinkButton>
<asp:Label ID="Label2" runat="server" Text="<%# Container.DataItem.ItemsPerPage %>" Visible='<%# Container.DataItem.IsSelected %>'/>
</ItemsPerPageChoiceTemplate>
This template defines the user interface element the user clicks for next block of pages. The default markup for the template is:
<NextBlockTemplate>
<asp:LinkButton runat="server" CommandArgument="<%# NextBlockTemplate
Container.Offset %>"
CommandName="ChangeOffset" >
<%# Container.Text %></asp:LinkButton> </NextBlockTemplate>
In this example, this template replaces the default element of >> with linked text that displays Next Block.
<NextBlockTemplate>
<asp:LinkButton runat="server" Text="Next Block" CommandName="ChangeOffset"
CommandArgument="<%# Container.Offset %>"> </asp:LinkButton>
</NextBlockTemplate>
This template defines the user interface element the user clicks for the next page of results. The default markup for the template is:
<NextPageTemplate>
<asp:LinkButton runat="server" CommandArgument="<%# NextPageTemplate
Container.Offset %>" CommandName="ChangeOffset" > <%# Container.Text %></asp:LinkButton>
</NextPageTemplate>
In this example, this template replaces the default element of > with linked text that displays Next Page.
<NextPageTemplate>
<asp:LinkButton ID="NextPageId1" runat="server" Text="Next Page"
Description Template name CommandName="ChangeOffset" CommandArgument="<%# Container.Offset %>"> </asp:LinkButton> </NextPageTemplate>
This template defines the user interface element the user clicks for previous block of pages. The default markup for the template is:
<PreviousBlockTemplate>
<asp:LinkButton runat="server" CommandArgument="<%# PreviousBlockTem¬
plate
Container.Offset %>" CommandName="ChangeOffset" > <%# Container.Text %></asp:LinkButton>
</PreviousBlockTemplate>
In this example, this template replaces the default element of << with linked text that displays Previous Block.
<PreviousBlockTemplate>
<asp:LinkButton runat="server" Text="Previous Block"
CommandName="ChangeOffset"
CommandArgument="<%# Container.Offset %>"> </asp:LinkButton>
</PreviousBlockTemplate>
This template defines the user interface element the user clicks for the previous page of results. The default markup for the template is:
<PreviousPageTemplate>
<asp:LinkButton runat="server" CommandArgument="<%# PreviousPageTem¬
plate
Container.Offset %>" CommandName="ChangeOffset" > <%# Container.Text %></asp:LinkButton>
</PreviousPageTemplate>
In this example, this template replaces the default element of < with linked text that displays Previous Page.
<PreviousPageTemplate>
<asp:LinkButton ID="NextPageId1" runat="server" Text="Previous Page"
CommandName="ChangeOffset" CommandArgument="<%# Container.Offset %>"></asp:LinkButton>
</PreviousPageTemplate>
This template defines what to display when no results are returned. The default markup for the template is:
<NoResultsTemplate> 0 Matching Records </NoResultsTemplate> NoResultsTemplate
In this example, the template replaces "0 matching records" with "No results".
<NoResultsTemplate> <div>No results</div> </NoResultsTemplate>
Description Template name
This template defines the list of pages to display. This is typically < 1, 2, 3, 4, > and so on. The default markup for the template is:
<OffsetChoiceTemplate>
<asp:LinkButton runat="server" CommandArgument="<%# OffsetChoiceTem¬
plate
Container.DataItem.Offset
%>" CommandName="ChangeOffset" Visible='<%# !Contain¬ er.DataItem.IsSelected %>'>
<%# Container.DataItem.DisplayValue %></asp:LinkButton>
<asp:Label ID="Label1" runat="server"
Text='<%# Container.DataItem.DisplayValue %>' Vis¬ ible='<%#
Container.DataItem.IsSelected %>'/> </OffsetChoiceTemplate>
For example:
<OffsetChoiceTemplate>
<asp:LinkButton runat="server" Visible="<%# !Contain¬ er.DataItem.IsSelected %>"
Text="<%# Container.DataItem.DisplayValue %>" CommandName="ChangeOffset"
CommandArgument="<%# Container.DataItem.Offset %>"></asp:LinkButton>
<asp:Label runat="server" Visible="<%# Contain¬ er.DataItem.IsSelected %>"
Text="<%# Container.DataItem.DisplayValue %>"></asp:Label>
</OffsetChoiceTemplate>
This template defines the three data items that indicate the first index of page results, last index page, and total number of results. The default markup for the template is:
<PagerResultsTemplate>
Results <asp:Label runat="server" PagerResultsTem¬
plate
Text="<%# Container.PagingInfo.FirstIndexOfPage %>" /> - <asp:Label
runat="server" Text="<%# Container.PagingInfo.LastIn¬ dexOfPage %>" />
of <asp:Label ID="Label3" runat="server" Text="<%#
Container.PagingInfo.TotalItemCount %>" /> </PagerResultsTemplate>
In this example, this information displays similar to Results 1 - 10 of 596 where 1 is the first index, 10 is the last index and 596 is the total number of results. For example:
<PagerResultsTemplate> <span>Results:</span>
<asp:Label ID="firstIndexId1" runat="server" Text="<%# Container.PagingInfo.FirstIndexOfPage %>"/> <span>-</span>
<asp:Label ID="lastIndexId1" runat="server" Text="<%# Container.PagingInfo.LastIndexOfPage %>"/> <span>of</span>
<asp:Label ID="totalRecordsId1" runat="server" Text="<%#
Description Template name
Container.PagingInfo.TotalItemCount %>"/> </PagerResultsTemplate>