I have a ListView control as follows (to publish here, I removed the values ββfrom my ItemTemplate):
<asp:ListView ID="ListView1" runat="server" DataSourceID="MyDataSource">
<LayoutTemplate>
<div id="requests" runat="server">
<asp:Panel runat="server" id="itemPlaceholder"></asp:Panel>
</div>
<asp:DataPager runat="server" ID="DataPager" PageSize="3">
<Fields>
<asp:NumericPagerField ButtonCount="10" PreviousPageText="<--" NextPageText="-->" />
</Fields>
</asp:DataPager>
</LayoutTemplate>
<ItemTemplate>
<div ID="itemPlaceholder" class="request" runat="server">
<asp:LinkButton ID="button" runat="server" Text='...' CommandName="..."
CommandArgument='...' OnClick="..."
style="...">
</asp:LinkButton> -
</div>
</ItemTemplate>
</asp:ListView>
This ListView exists as a user control (.ascx) that I have embedded in an ASPX web page.
As I expected, when the web page loads, for a list of 9 elements I get 3 pages of 3 items.
When I click to go to the next page, the page loads the next set of elements correctly ... but only for a short second. Then a strange thing happens. The page inserts a copy of itself into the page 6 times, each of which is under one of the form fields inside the page.
If I try to go to the next or previous page, an ASP.NET server error will appear:
.
:
FormatException: Base-64, - , .
ViewStateException: .
, IE8 Chrome.