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 ...
随机推荐
- 我的javascript学习之路(一)对象之基础
做了2个多月的ajax项目,对js的学习觉得了深入了不少,把自己的一些学习的经验贴出来,希望对初学者有所帮助,也希望大家能指出我的错误之处或者不当之处. javascript 是基于对象的语言,为什么 ...
- c语言write与python的struct模块交互
以下讲的都是用二进制形式打开文件.网上有很多struct模块的文章,下面是我做的小实验. 1.对于c里面的fwrite写入一个单字节,写的就是它的二进制.如3,写入文件就是二进制0x03,它并不是3的 ...
- google对js延迟加载方案的建议
浏览器在执行JavaScript代码时会停止处理页面,当页面中有很多JavaScript文件或代码要加载时,将导致严重的延迟.尽管可以使用defer.异步或将JavaScript代码放到页面底部来延迟 ...
- oc-15-枚举结构体
Cat.h #import <Foundation/Foundation.h> // 颜色的枚举 typedef enum{ ColorBlack, ColorYeallow } Colo ...
- oralce 函数 FOR windows 跟踪神器
https://github.com/dennis714 http://www.yurichev.com
- 让Laravel5支持memcache的方法
Laravel5框架在Cache和Session中不支持Memcache,看清了是Memcache而不是Memcached哦,MemCached是支持的但是这个扩展真的是装的蛋疼,只有修改部分源码让其 ...
- tachyon with hadoop
hadoop2.2.0 jdk1.7 tachyon0.5.0 无zookeeper tachyon和hadoop都是伪分布式模式 1.修改core-site.xml文件 <property&g ...
- js的2种继承方式详解
js中继承可以分为两种:对象冒充和原型链方式 一.对象冒充包括三种:临时属性方式.call()及apply()方式1.临时属性方式 复制代码代码如下: function Person(name){ ...
- EMS电子面单接口对接使用-免费版
快递鸟电子面单接口,可一次对接15家快递公司, 无需和每一家快递公司做对接.支持快递有四通一达.顺丰.EMS.宅急送.德邦.优速等15家快递公司,对顺丰有电子面单服务需求的可以选择顺丰自有的电子面单或 ...
- 1.4.2 solr字段类型--(1.4.2.3)使用货币和汇率
1.4.2 solr字段类型 (1.4.2.1) 字段类型定义和字段类型属性. (1.4.2.2) solr附带的字段类型 (1.4.2.3) 使用货币和汇率 (1.4.2.4) 使用Dates(日期 ...