分页控件-ASP.NET(AspNetPager)

 

分页控件-ASP.NET(AspNetPager)
<div class="oa-el-grid-page">
        <webdiyer:AspNetPager ID="AspNetPager2" runat="server" CurrentPageButtonClass="current"
            OnPageChanging="AspNetPager2_PageChanging" FirstPageText="首页" LastPageText="最后一页"
            NextPageText="下一页" PrevPageText="上一页" HorizontalAlign="Center" ShowBoxThreshold="10"
            ShowPageIndexBox="Auto" AlwaysShow="True" PageSize="9">
        </webdiyer:AspNetPager>
        &nbsp;`
    </div>
分页控件-ASP.NET(AspNetPager)
分页控件-ASP.NET(AspNetPager)
.oa-el-grid-page a, .oa-el-grid-page input[type="submit"] {
    background-color: #FFFFFF;
    border-color: #EEEEEE;
    border-style: solid;
    border-width: 1px;
    color: #036CB4;
    margin: 2px;
    padding: 2px 5px;
    text-decoration: none;
}
.oa-el-grid-page .current {
    background-color: #036CB4;
    border-color: #036CB4;
    border-right: 1px solid #036CB4;
    border-style: solid;
    border-width: 1px;
    color: #FFFFFF;
    font-weight: bold;
    margin: 2px;
    padding: 2px 5px;
}
分页控件-ASP.NET(AspNetPager)

 

分页控件-ASP.NET(AspNetPager)
 public void DataLoad(int pidx)
        {
            string TiaoJian = " 1=1 ";
            if (txtxfd.Value != "")
                TiaoJian += " and name like ‘%" + txtxfd.Value + "%‘";
            AspNetPager2.RecordCount = new BLL.Sys_card_class().GetCount(TiaoJian);

                                                                                  //分页大小、页码、排序列,升序{False}/降序(True),条件
            List<Model.Sys_card_class> LRDate = new BLL.Sys_card_class().GetPageList(AspNetPager2.PageSize, pidx, "id", false, TiaoJian);
            if (LRDate.Count > 0)
            {
                int i = 1;
                foreach (Model.Sys_card_class LR in LRDate)
                {
                    ContentStr += "<tr>";
                    ContentStr += "<td width=\"200px\">" + i.ToString() + "</td>";
                    ContentStr += "<td width=\"310px\">" + LR.id.ToString() + "</td>";
                    ContentStr += "<td width=\"310px\">" + LR.name.ToString() + "</td>";

                    ContentStr += "<td  width=\"130px\">";
                    ContentStr += "<a href=‘Card_class_Edit.aspx?addoredit=edit&id=" + LR.id.ToString() + @"‘>编辑</a>";
                    ContentStr += "&nbsp;&nbsp;&nbsp;&nbsp;<a class=\"linkcss\" href=\"#\" onclick=\"javascript:if(confirm(‘确定要删除吗?‘)){DeleMenu(‘" + LR.id.ToString() + "‘);}\" title=\"删除\">删除</a>";
                    ContentStr += "&nbsp;</td>";
                    ContentStr += "</tr>";

                    i++;
                }

            }
        }

        protected void AspNetPager2_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
        {
            DataLoad(e.NewPageIndex);
        }
分页控件-ASP.NET(AspNetPager)

AspNetPager是asp.net中常用的分页控件,下载AspNetPager.dll,添加引用,在工具栏就可以看到AspNetPager控件:

分页控件-ASP.NET(AspNetPager),布布扣,bubuko.com

分页控件-ASP.NET(AspNetPager)

上一篇:用css3实现图片左右翻转


下一篇:IIS发布的网站用localhost可以访问,改成IP就无法访问的解决方案 .