Ho inserito un datapager in un listview per paginare (ovviamente non si può fare diversamente)
e funziona benissimo.
Vorrei solo che al click del datapager ci fosse un full postback.
Dopo la paginazione l'utente dovrebbe tornare al top della pagina per vedere gli articoli dall'inizio.
<asp:updatepanel ID="updPanelListView" runat="server" >
<ContentTemplate>
<asp:ListView ID="ListViewCatalogo" runat="server" DataKeyNames="codart,codvar" OnPagePropertiesChanging="ListViewCatalogo_PagePropertiesChanging" OnDataBound="ListViewCatalogo_DataBound"
ItemPlaceholderID="itemPlaceHolder1">
<LayoutTemplate>
<table >
<asp:PlaceHolder runat="server" ID="itemPlaceHolder1"/>
</table>
<div class="row">
<div class="col-md-12">
<asp:DataPager ID="CatalogoDataPager" OnPreRender="CatalogoDataPager_PreRender" runat="server" PageSize="9">
<Fields>
<asp:NextPreviousPagerField RenderNonBreakingSpacesBetweenControls="false" ButtonCssClass="pagerButton" FirstPageText="<<" PreviousPageText="<" ShowFirstPageButton="True" ShowNextPageButton="False" />
<asp:NumericPagerField RenderNonBreakingSpacesBetweenControls="false" CurrentPageLabelCssClass="pagerButtonCurrentPage" NextPreviousButtonCssClass="pagerButton" NumericButtonCssClass="pagerButton" />
<asp:NextPreviousPagerField RenderNonBreakingSpacesBetweenControls="false" ButtonCssClass="pagerButton" LastPageText=">>" NextPageText=">" ShowLastPageButton="True" ShowPreviousPageButton="False" />
<asp:TemplatePagerField>
<PagerTemplate>
<div style="color:gray;font-size:x-large;float:right;">
da
<asp:Label ID="CurrentRowTextBox" runat="server"
AutoPostBack="true"
Text="<%# Container.StartRowIndex + 1%>"
Columns="1"
style="text-align:right"
OnTextChanged="CurrentRowTextBox_OnTextChanged" />
a
<asp:Label ID="PageSizeLabel" runat="server" Font-Bold="true"
Text="<%# Container.StartRowIndex + Container.PageSize > Container.TotalRowCount ? Container.TotalRowCount : Container.StartRowIndex + Container.PageSize %>" />
di
<asp:Label ID="TotalRowsLabel" runat="server" Font-Bold="true"
Text="<%# Container.TotalRowCount %>" />
articoli
</div>
</PagerTemplate>
</asp:TemplatePagerField>
</Fields>
</asp:DataPager>
</div>
</div>
</LayoutTemplate>
<ItemTemplate>
<div class="col-md-4">
................
<div class="row"> </div>
</div>
</ItemTemplate>
</asp:ListView>
</ContentTemplate>
<Triggers>
</Triggers>
</asp:updatepanel>
Come posso fare ?
Debbo fare una classe per il paging e gestire tutto "manualmente" ?
grazie
Modificato da jjchuck il 14 luglio 2016 15.55 -