AspNetPager.dll 用法

AspNetPager.dll下载地址

页面应用控件

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="cc1" %>

分页控件

<cc1:AspNetPager ID="AspNetPager1" runat="server" Width="500px" FirstPageText="首页"
                    LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" Height="40px" NumericButt
                    PagingButt ShowNavigati ShowInputBox="Always" TextAfterInputBox="" TextBeforeInputBox="跳转到第"
                    AlwaysShow="True" OnPageChanged="AspNetPager1_PageChanged">
               </cc1:AspNetPager>

后台AspNetPager1_PageChanged事件

protected void AspNetPager1_PageChanged(object src, Wuqi.Webdiyer.PageChangedEventArgs e)
        {
            AspNetPager1.CurrentPageIndex = e.NewPageIndex;
          DataBind_Project(Convert.ToInt16(this.DropDownList1.SelectedValue),Convert.ToInt16(this.DropDownList2.SelectedValue));       
 }

绑定数据

/// <summary>
        /// 绑定方案数据
        /// </summary>
        private void DataBind_Project(int year, int sesaon)
        {
            string where = string.Empty;
            if (year == -1 && sesaon == -1)
            {
                where = "where  Card_id='" + cardNo + "'";
            }
            else
            {
                if (year == -1)
                {
                    where = "where Season=" + sesaon + " and  Card_id='" + cardNo + "'";
                }
                else if (sesaon == -1)
                {
                    where = "where Project_year=" + year + " and  Card_id='" + cardNo + "'";
                }
                else
                {
                    where = "where Season=" + sesaon + " and Project_year=" + year + " and  Card_id='" + cardNo + "'";
                }
            }
            int count = 0;
            List<T_ProjectEntity> list_project = FrameWork.BusinessFacade.T_ProjectList(new QueryParam() { TableName = "T_Project", Where = where, Orderfld = "Create_Time", OrderType = 0, PageIndex = AspNetPager1.CurrentPageIndex, PageSize = AspNetPager1.PageSize }, out count);
            this.rptProject.DataSource = list_project;
            this.DataBind();
            this.AspNetPager1.RecordCount = count;
        }

编号序列号从新排列

前台<%# (this.AspNetPager1.CurrentPageIndex - 1) * this.AspNetPager1.PageSize + Container.ItemIndex + 1%>

转载于:https://www.cnblogs.com/LoVeSW/articles/3420312.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值