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();
    
  • 相关阅读:
    ddl(数据定义语言) ,dml (数据操控语言),dcl(数据控制语言)
    集合框架
    泛型(模拟list)
    Clone
    线程问题以及调用
    面向对象(封装、继承、多态、抽象)
    SpringMVC的四个核心接口
    VUE项目报错 This is probably not a problem with npm. There is likely additional logging output above.
    debian java8 cacerts 证书的丢失
    yii2 ,thinkphp的伪静态
  • 原文地址:https://www.cnblogs.com/dandanwozhishidan/p/3755607.html
Copyright © 2011-2022 走看看