<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();

dropdownlist分页的更多相关文章

  1. GridView总结一:GridView自带分页及与DropDownList结合使用

    GridView自带的分页功能实现: 要实现GrdView分页的功能 操作如下: 1.更改GrdView控件的AllowPaging属性为true. 2.更改GrdView控件的PageSize属性为 ...

  2. asp.net webform 自定义分页控件

    做web开发一直用到分页控件,自己也动手实现了个,使用用户自定义控件. 翻页后数据加载使用委托,将具体实现放在在使用分页控件的页面进行注册. 有图有真相,给个直观的认识: 自定义分页控件前台代码: & ...

  3. Application对象、ViewState对象、分页展示--2017年1月4日

    Application对象 存储 Application 变量  Application["application名称"] = "application的值"; ...

  4. weibform中Application、ViewState对象和分页

    Application: 全局公共变量组 存放位置:服务器 特点:所有访问用户都是访问同一个变量,但只要服务器不停机,变量一直存在于服务器的内存中,不要使用循环大量的创建Application对象,可 ...

  5. webform 分页、组合查询综合使用

    界面: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx ...

  6. Web 分页

    以Car表为例分页 页面以table展示数据分页 页面代码 <asp:Repeater ID="Repeater1" runat="server"> ...

  7. WebForm Application Viewstate 以及分页(功能性的知识点)

    Application: 全局公共变量组 存放位置:服务器 特点:所有访问用户都是访问同一个变量,但只要服务器不停机,变量一直存在于服务器的内存中,不要使用循环大量的创建Application对象,可 ...

  8. LinQ的组合+分页

    前台代码: 名称:<asp:TextBox ID="Textname" runat="server"></asp:TextBox> 油耗 ...

  9. MVC - 11(下)jquery.tmpl.js +ajax分页

    继续 mvc-11(上).dto:http://www.cnblogs.com/tangge/p/3840060.html jquery.tmpl.js 下载:http://pan.baidu.com ...

随机推荐

  1. Codeforces Round #339 (Div. 2) B. Gena's Code 水题

    B. Gena's Code 题目连接: http://www.codeforces.com/contest/614/problem/B Description It's the year 4527 ...

  2. C# 6与VB 12即将加入模式匹配

    又有一种源自于函数式编程语言中的概念加入了C#和VB的阵营,这就是被称为模式匹配(Pattern Matching)的特性.初看上去,模式匹配的作用类似于一段switch/select语句块,但它的功 ...

  3. [Express] Level 4: Body-parser -- Post

    Parser Setup Assume the body-parser middleware is installed. Now, let's use it in our Express applic ...

  4. Perl 引用与匿名数组

    写这篇是因为工作遇到一个需要使用列表作为hash的值的问题,这在Python中是非常简单而轻松的事,如下面这段python程序. def add_to_index(index, keyword, ur ...

  5. C#操作SQL Server通用类

    using System; using System.Data; using System.Xml; using System.Data.SqlClient; using System.Collect ...

  6. git的.gitignore配置

    .gitignore 配置文件用于配置不需要加入版本管理的文件,配置好该文件可以为我们的版本管理带来很大的便利,以下是个人对于配置 .gitignore 的一些心得. 1.配置语法: 以斜杠“/”开头 ...

  7. vim的列编辑操作

    转载:http://www.cnblogs.com/xiaowant/articles/1992923.html 删除列 1.光标定位到要操作的地方. 2.CTRL+v 进入“可视 块”模式,选取这一 ...

  8. LeetCode29 Divide Two Integers

    题目: Divide two integers without using multiplication, division and mod operator. If it is overflow, ...

  9. redis 简介

    Redis是一种高级key-value数据库.它跟memcached类似,不过数据可以持久化,而且支持的数据类型很丰富.有字符串,链表,集 合和有序集合.支持在服务器端计算集合的并,交和补集(diff ...

  10. CSS 之 内层div填充margin,外层div的背景色不会覆盖该margin

    外层元素(如div)中只有一个非空子元素,此时margin是被折叠了.两者之间取最大的margin值,表现在外层父元素上,而不是内层子元素. 注意: (1)只有垂直方向上才会出现此现象,水平方向不会出 ...