Search code examples
asp.netlistviewdrop-down-menupaginationdatapager

How can I display the same DataPager control in two places on a page at the same time?


I have a DataPager control that looks like this:

<asp:DataPager ID="page1" PagedControlID="ExperienceList" runat="server" PageSize="3" OnPreRender="page1_PreRender">
<Fields>
<asp:TemplatePagerField>
<PagerTemplate>
<asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" CssClass="default"
OnSelectedIndexChanged="ddlPage_SelectedIndexChanged"></asp:DropDownList>
</PagerTemplate>
</asp:TemplatePagerField>
</Fields>
</asp:DataPager>

I have slotted this datapager control into a place where I want my dropdown to appear.

This is all working great, but my problem now is that I need another dropdown control to function in exactly the same way, but at the bottom of the listview as well as this one, which is at the top.

Is there any way I can piggyback this existing datapager, or do I have to create an entirely separate datapager at the bottom of the listview and somehow link them together?


Solution

  • Just create a second data pager and hook the events up to the same event handlers