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 ...
随机推荐
- 初识ASP.NET---若干常见错误
近期在学习ASP.NET的相关知识,期间遇到了一些错误,比較常见的错误总结了一下,希望此文能给ASP.NET刚開始学习的人一些帮助.同一时候记录这些错误也方便今后自己查看. 1. GridView& ...
- Ubuntu 改动bash
ubuntu下/bin/sh的指向 ubuntu 下 /bin/sh 默认是dash,用ll /bin/sh就能够看出来sh是指向dash的链接.有时候会导致使用bash脚本的时候出问题. 假 ...
- 怎样用JS来添加CSS样式
方法: document.getElementById("xx").style.xxx中的全部属性是什么 盒子标签和属性对比 CSS语法(不区分大写和小写) JavaScript语 ...
- static使用方法小结
static使用方法小结 statickeyword是C, C++中都存在的keyword, 它主要有三种使用方式, 当中前两种仅仅指在C语言中使用, 第三种在C++中使用(C,C++中详细细微操作不 ...
- ssl/https双向验证的配置
1.SSL认证 不需要特别配置,相关证书库生成看https认证中的相关部分 2.HTTPS认证 一.基本概念 1.单向认证,就是传输的数据加密过了,但是不会校验客户端的来源 2.双向认证,如果客户端 ...
- [Express] Level 2: Middleware -- 1
Mounting Middleware Given an application instance is set to the app variable, which of the following ...
- Java Swing 探索(一)LayoutManager
BorderLayout FlowLayout GridLayout GridBagLayout CardLayout BoxLayout 1.BorderLayout java.lang.Objec ...
- 类string的构造函数、拷贝构造函数和析构函数
原文:http://www.cnblogs.com/Laokong-ServiceStation/archive/2011/04/19/2020402.html 类string的构造函数.拷贝构造 ...
- mysql loop if
MYSQL: loop if ITERATE: 跳出此次循环,直接进入到下一次循环中 LEAVE: 结束循环,跳出整个循环. demo如下: CREATE TABLE t( v INT NOT ...
- 把你的旧笔记本变成 Chromebook
导读 Linux 之年就在眼前.根据报道,Google 在 2016 年第一季度卖出了比苹果卖出的 Macbook 更多的 Chromebook.并且,Chromebook 即将变得更加激动人心.在 ...