使用aspNetPager分页

dll见附件

aspNetPager控件

  public void GridViewBinding(int PageSize, string SqlSelect, string FilterString, string ID, int lower, string OrderBy, GridView gv, Wuqi.Webdiyer.AspNetPager YsmPager1)
    {
        string sql = "";
        sql += "select top " + PageSize.ToString() + " * from ( ";
        sql += " SELECT ROW_NUMBER() OVER (ORDER BY " + ID + ") AS RowNumber,* from (" + SqlSelect + FilterString + ") as a";
        sql += ") b";
        //if (lower > 0)
        //{
        //    sql += " where " + ID + " not in (select top " + lower.ToString() + " " + ID + " from (" + SqlSelect + FilterString + ") as b " + OrderBy + ")";
        //}

        if (lower > 0)
        {
            sql += " where RowNumber>" + lower + "";
        }
        sql += " " + OrderBy + "";

        DataTable dt = MDGL.DBUtility.SQLServerHelper.GetDataTable(CommandType.Text, sql);
        gv.DataSource = dt;
        gv.DataBind();

        sql = "select count("+ID+") from ( " + SqlSelect + FilterString + ") as a";
        Object object01 = MDGL.DBUtility.SQLServerHelper.ExecuteScalar(CommandType.Text, sql);

        YsmPager1.RecordCount = int.Parse(object01.ToString());
        if (YsmPager1.RecordCount==0)
        {
            YsmPager1.Visible = false;
        }
        else
        {
            YsmPager1.Visible = true;
        }

    }

使用aspNetPager分页

时间: 2024-10-14 08:28:38

使用aspNetPager分页的相关文章

PagedDataSource数据绑定控件和AspNetPager分页控件结合使用列表分页

1.引用AspNetPager.dll. 2.放置Repeater数据绑定控件. <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> //绑定显示的列表代码 </ItemTemplate> </asp:Repeater> 3.在页面添加AspNetPager分页控件,会出现以下代码. <%@ Register Assembly="Asp

【转】AspNetPager分页控件用法

AspNetPager分页控件解决了分页中的很多问题,直接采用该控件进行分页处理,会将繁琐的分页工作变得简单化,下面是我如何使用AspNetPager控件进行分页处理的详细代码: 1.首先到www.webdiyer.com下载最新的AspNetPager.dll,直接在vs2005中添加引用即可. 2.在页面上注册控件,引入该控件,当然,需要在页面中使用一个数据载体,我这里使用的是repeater控件. <%@ Register Assembly="AspNetPager" Na

【Bootstrap3.0建站笔记三】AspNetPager分页,每一列都可排序

1.AspNetPager分页,实现每一列都可排序: (1).需要将默认排序字段放在HTML页面中. (2).排序字段放置为td节点的属性. 如图: 实现的效果图如: HTML代码: <div class="row"> <div class="col-lg-12 col-sm-12 col-xs-12 col-xxs-12"> <table class="table table-striped table-hover tabl

C# Repeater、webdiyer:AspNetPager分页 AspNetPager分页样式

AspNetPager分页样式:1.网易风格 2.拍拍风格 3.迅雷风格 地址:http://www.webdiyer.com/aspnetpagerdemo/applystyles/default.aspx BootScript框架下分页: <div class="row"> <div class="col-lg-1 col-sm-4 col-xs-4 col-xxs-12"> </div> <div class=&quo

AspNetPager 分页的详细用法(ASP.NET)

1.[添加AspNetPager.dll文件] 2.[使用方法] public static DataTable GetRecord(SystemModel.Pager mt, ref int TotalPage, ref int TotalRecord) { string sortType = mt.SortType == 1 ? " asc" : " desc"; //查询总条数 string _strCountSQL = "select count(

ASPNETPAGER分页控件

ASPNETPAGER分页控件的使用方法, 比较基础. 1. 加入dll文件这是必须的. 2.拖入控件到应用位置,添加引用: 引用: <%@ Register Assembly="AspNetPager" Namespace="AspNetPagerr" TagPrefix="webdiyer" %> 控件: 代码如下: <div style="text-align:center;"> <webd

三层架构下AspNetPager分页实现

首先是建一张表: CREATE TABLE [dbo].[UserInfo] ( [uId]          INT           IDENTITY (1, 1) NOT NULL, [uName]        NVARCHAR (50) NULL, [uPassWord]    NVARCHAR (50) NULL, [uEmail]       NVARCHAR (50) NULL, [uPic]         NVARCHAR (50) NULL, PRIMARY KEY CL

AspNetPager分页

1.页面部分 <%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %> <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="10"                 CustomIn

.net中实现aspnetpager分页

第一步首先导入aspnetpager控件,然后再把他从工具箱中拖出,代码如下: <webdiyer:AspNetPager ID="aspnetpager1" runat="server" CustomInfoTextAlign="Left" FirstPageText="首页 " LastPageText ="末页" NextPageText=" 下一页" NumericButt