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 ...
随机推荐
- hdu 5264 pog loves szh I 水题
pog loves szh I Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?p ...
- uoj #5. 【NOI2014】动物园 kmp
#5. [NOI2014]动物园 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://uoj.ac/problem/5 Description 近日 ...
- OpenGL中的功能与OSG对应功能 (摘)
将OpenGL中的功能与OSG对应功能进行列举: OpenGL function OpenSceneGraph implementation glClear( GLbitfield mask ) os ...
- 使用generator自动生成Mybatis映射配置文件
在使用mybatis时,映射文件的配置非常麻烦,对于做逻辑不是很复杂,功能不是特别关键的模块的时候,我们没有必要手动书写,可以使用generator工具生成. generator工具实际上就是根据数据 ...
- [Javascript] Promise-based functions should not throw exceptions
Source You can also start a chain of then() method calls via Promise.resolve() and execute the synch ...
- Python基础教程之第2章 列表和元组
D:\>python Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)] on win32 Typ ...
- typedef函数指针使用方法
1.简单的函数指针的应用 形式1:返回类型(*函数名)(參数表) char (*pFun)(int); char glFun(int a){ return;} void main() { pFun = ...
- c#如何在win7下设置IE代理的完美解决方案
有人还发现:在window7下, 在一个进程中, 设置和取消不能都执行,---- 要么设置,要么取消. 但如果第一次运行时,只进行设置代理,退出后再进运行,只进行取消,这是没有问题的. 简单说说中医 ...
- QThread与QWidget使用
本文主要内容: 在任务一中,用 四 种方式实现:点击界面按钮,开线程运行一段程序,结果显示在一个Label上.1. 用不正确的方式得到看似正确的结果2. 用Qt Manual 和 例子中使用的方法3. ...
- Java 使用 Redis
安装 开始在 Java 中使用 Redis 前, 我们需要确保已经安装了 redis 服务及 Java redis 驱动,且你的机器上能正常使用 Java. Java的安装配置可以参考我们的 Ja ...