zoukankan      html  css  js  c++  java
  • dropdownlist分页

    <div class="new-paging" id="">
                <div class="new-tbl-type">
                    <div class="new-tbl-cell">
                        <a href="<%=prevurl %>" class="new-a-prve"><span>上一页</span></a>
                    </div>
                    <div class="new-tbl-cell new-p-re" id="pagelist">
                        <div class="new-a-page">
                            <span class="new-open">1/100</span>
                        </div>
                        <asp:DropDownList ID="pageselect" runat="server" class="new-select" onchange="combocg(this);">
                        </asp:DropDownList>
                    </div>
                    <div class="new-tbl-cell">
                        <a href="<%=nexturl %>" class="new-a-next"><span>下一页</span></a>
                    </div>
                </div>
            </div>
     List<student"> list = null;
               	 List<student"> listst = null;
     		 SqlParameter[] parames = new SqlParameter[0]; 
    		string selsql="select * from student";
         		DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.SqlConncectionString, CommandType.Text, selSql, parames);
    		if (ds != null && ds.Tables[0].Rows.Count > 0)  
            	{  
               		rowsCount = ds.Tables[0].Rows.Count;
           		 }    
                    if ((nowPage - 1) * pageSize > rowsCount) nowPage = 1;
                    int takecount = rowsCount - (nowPage - 1) * pageSize;
                    if (takecount > pageSize)
                        listst = list.Skip((nowPage - 1) * pageSize).Take(pageSize).ToList();
                    else
                        listst = list.Skip((nowPage - 1) * pageSize).Take(takecount).ToList();
                    foreach (var img in listst)
                    {
                        img.C_IMGURL = img.C_IMGURL.Replace(".", "_130_140.");
                    }
                    pageselect.Items.Clear();
                    int pagecount = rowsCount % pageSize > 0 ? rowsCount / pageSize + 1 : rowsCount / pageSize;
                    for (int i = 0; i < pagecount; i++)
                    {
                        pageselect.Items.Add(new ListItem("第" + (i + 1).ToString() + "页", (i + 1).ToString()));
                    }
                    rplist.DataSource = listst;
                    rplist.DataBind();//绑定Repeater
                    url = "/Web/Manage/fenye.aspx?";
                    url += "&page=";
                    prevurl = nowPage > 1 ? url + (nowPage - 1) : url + "1";
                    nexturl = nowPage < pagecount ? url + (nowPage + 1) : url + nowPage;
                    pageselect.SelectedValue = nowPage.ToString();
    
  • 相关阅读:
    ArcGIS10.1的安装问题
    谁是农业信息化的第一推动力
    名片
    【旺铺2012分享】导航CSS代码使用修改技巧!
    新旺铺教程之导航12
    新旺铺教程之导航
    Photoshop制作通透的紫色宝石字
    用PS怎么画虚线圆?
    一张彩色图片,如何用Photoshop处理成一张轮廓图(就是变成刚用铅笔画出来时的那样)_...
    php从入门到放弃系列-01.php环境的搭建
  • 原文地址:https://www.cnblogs.com/dandanwozhishidan/p/3755607.html
Copyright © 2011-2022 走看看