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();
dropdownlist分页的更多相关文章
- GridView总结一:GridView自带分页及与DropDownList结合使用
GridView自带的分页功能实现: 要实现GrdView分页的功能 操作如下: 1.更改GrdView控件的AllowPaging属性为true. 2.更改GrdView控件的PageSize属性为 ...
- asp.net webform 自定义分页控件
做web开发一直用到分页控件,自己也动手实现了个,使用用户自定义控件. 翻页后数据加载使用委托,将具体实现放在在使用分页控件的页面进行注册. 有图有真相,给个直观的认识: 自定义分页控件前台代码: & ...
- Application对象、ViewState对象、分页展示--2017年1月4日
Application对象 存储 Application 变量 Application["application名称"] = "application的值"; ...
- weibform中Application、ViewState对象和分页
Application: 全局公共变量组 存放位置:服务器 特点:所有访问用户都是访问同一个变量,但只要服务器不停机,变量一直存在于服务器的内存中,不要使用循环大量的创建Application对象,可 ...
- webform 分页、组合查询综合使用
界面: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx ...
- Web 分页
以Car表为例分页 页面以table展示数据分页 页面代码 <asp:Repeater ID="Repeater1" runat="server"> ...
- WebForm Application Viewstate 以及分页(功能性的知识点)
Application: 全局公共变量组 存放位置:服务器 特点:所有访问用户都是访问同一个变量,但只要服务器不停机,变量一直存在于服务器的内存中,不要使用循环大量的创建Application对象,可 ...
- LinQ的组合+分页
前台代码: 名称:<asp:TextBox ID="Textname" runat="server"></asp:TextBox> 油耗 ...
- MVC - 11(下)jquery.tmpl.js +ajax分页
继续 mvc-11(上).dto:http://www.cnblogs.com/tangge/p/3840060.html jquery.tmpl.js 下载:http://pan.baidu.com ...
随机推荐
- PP常见数据表
Table表 Short text短文本 AFFL Work order sequence加工单顺序 AFFT Order process instructions订单-流程指令 A ...
- Codeforces Gym 100463A Crossings 逆序数
Crossings Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100463 Description ...
- Linux/RedHat 编译安装GNU gcc 4.9.0 (g++)
这里说的是编译安装,yum/apt-get 等安装方法比較简单,不阐述! 1.下载源代码包:gcc.gnu.org 2.解压: tar -xjvf gcc-4.9.0.tar.bz2 3.下载编译所需 ...
- 深入解析 ext2 文件系统
很久以来,就想写一篇关于ext 家族文件系统的文章,源于我刚工作的时候,曾经一不小心rm -rf,误删除了很多文件,当时真想有个数据恢复软件能帮我把数据回复了.当然学习数据恢复,首先要学习文件系统. ...
- ORB:新一代 Linux 应用
Orbital Apps 给我们带来了一种新的软件包类型 ORB,它具有便携软件.交互式安装向导支持,以及离线使用的能力. 便携软件很方便.主要是因为它们能够无需任何管理员权限直接运行,也能够带着所有 ...
- 基于ARM-LINUX的温度传感器驱动-DS18B20
转载:http://blog.csdn.net/ayangke/article/details/6883244 作者:冯建,华清远见嵌入式学院讲师. DS18B20数字温度传感器接线方便,封装成后可应 ...
- Dockerfile 指令
FROM 格式为 FROM <image>或FROM <image>:<tag> 第一条指令必须为 FROM 指令.并且,如果在同一个Dockerfile中创建多个 ...
- Cyclic Nacklace
Problem Description CC always becomes very depressed at the end of this month, he has checked his cr ...
- 根据表结构自动生成JavaBean,史上最强最专业的表结构转JavaBean的工具(第2版)
目录: 第1版:http://blog.csdn.net/vipbooks/article/details/51912143 ...
- shell 获取cpu使用率
1.shell脚本获取主机每颗CPU使用率的方法. #!/bin/bash interval= cpu_num=`-] -c` start_idle=() start_total=() cpu_rat ...