zoukankan      html  css  js  c++  java
  • DataPager控件使用

    APSX:

     1 <asp:ListView ID="LvResult" runat="server"        onpagepropertieschanging="LvResult_PagePropertiesChanging" >
     2     .......
     3 </asp:ListView>
     4 <asp:DataPager runat="server"  ID="ContactsDataPager" PageSize="10" PagedControlID="LvResult"> 
     5     <Fields> 
     6         <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="False" 
     7                    FirstPageText="首页" LastPageText="尾页" 
     8                    NextPageText="下一页" PreviousPageText="上一页" ShowNextPageButton="False" ButtonType="Link" />
     9         <asp:TemplatePagerField> 
    10             <PagerTemplate>
    11                 <b><%# Container.TotalRowCount>0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %></b>
    12             </PagerTemplate>
    13         </asp:TemplatePagerField> 
    14         <asp:NextPreviousPagerField ShowFirstPageButton="False" ShowLastPageButton="True" 
    15                    FirstPageText="首页" LastPageText="尾页"  
    16                    NextPageText="下一页" PreviousPageText="上一页" ShowNextPageButton="True" ShowPreviousPageButton="False" />
    17         <asp:TemplatePagerField>
    18             <PagerTemplate> 
    19                 <b><%# Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %>页 ( 共<%# Container.TotalRowCount%>条记录   每页<%# Container.PageSize%>条) </b> 
    20             </PagerTemplate> 
    21         </asp:TemplatePagerField> 
    22     </Fields> 
    23 </asp:DataPager> 

    CS:

     1 protected void BtnSearch_Click(object sender, EventArgs e)
     2 {
     3     ContactsDataPager.SetPageProperties(0, 10, false);
     4     BindData();
     5 }
     6 protected void LvResult_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
     7 {
     8     ContactsDataPager.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
     9     BindData();
    10 }
    11 private void BindData()
    12 {
    13     ......
    14 }
  • 相关阅读:
    Vue优化首页加载速度 CDN引入
    vue中前进刷新、后退缓存用户浏览数据和浏览位置的实践
    node.js
    keep-alive前进没有刷新
    移动端ios和安卓input问题
    前端技术原理
    Vue给子组件传值为空
    使用vue开发输入型组件更好的一种解决方式(子组件向父组件传值,基于2.2.0)
    Vue路由参数设置可有可无
    Vue组件的三种调用方式
  • 原文地址:https://www.cnblogs.com/zhuhc/p/3455083.html
Copyright © 2011-2022 走看看