zoukankan
html css js c++ java
分页控件(.ascx文件)
<
script
>
var
strURL
=
'
<%=
strURL
%>
';
var
recordNum
=<%=
recordNum
%>
;
var
perPageNum
=<%=
perPageNum
%>
;
var
currentPage
=<%=
pageIndex
%>
;
var
p
=<%=
pageIndex
%>-
1
;
var
fontcolor
=
'
<%=
fontcolor
%>
';
if
(recordNum
%
perPageNum
==
0
)
{
pageNum
=
recordNum
/
perPageNum;
}
else
{
pageNum
=
(recordNum
-
recordNum
%
perPageNum)
/
perPageNum
+
1
;
}
document.write('
<
table border
=
"
0
"
cellpadding
=
"
0
"
cellspacing
=
"
3
"
width
=
"
<%=tableWidth%>
"
align
=
"
center
"
>
');
document.write('
<
form method
=
post action
=
"
'+strURL+'
"
>
');
document.write('
<
tr style
=
"
font-size: 12px;
"
><
td valign
=
"
middle
"
>
');
document.write('页次:
<
b
>
'
+
currentPage
+
'
</
b
>/<
b
>
'
+
pageNum
+
'
</
b
>
页 每页
<
b
>
'
+
perPageNum
+
'
</
b
>
共计:
<
b
>
'
+
recordNum
+
'
</
b
>
条数据
</
td
>
');
document.write('
<
td valign
=
"
middle
"
><
div align
=
"
right
"
>
分页:');
if
(currentPage
==
1
)
{
document.write('
<
font face
=
webdings color
=
"
'+fontcolor+'
"
>
9
</
font
>
');
}
else
{
document.write('
<
a href
=
"
'+strURL+'?page=1
"
title
=
"
首页
"
><
font face
=
webdings
>
9
</
font
></
a
>
');
}
if
(currentPage
>
10
)
{
document.write('
<
a href
=
"
'+strURL+'?page='+(currentPage-10)+'
"
title
=
"
上十页
"
><
font face
=
webdings
>
7
</
font
></
a
>
');
}
document.write('
<
b
>
');
for
(i
=
p
-
p
%
10
+
1
;i
<
p
-
p
%
10
+
1
+
10
;i
++
)
{
if
(i
==
pageNum
+
1
)
break
;
if
(i
==
currentPage)
{
document.write('
<
font color
=
"
'+fontcolor+'
"
>
'
+
i
+
'
</
font
>
');
}
else
{
document.write('
<
a href
=
"
'+strURL+'?page='+i+'
"
>
'
+
i
+
'
</
a
>
');
}
}
document.write('
</
b
>
');
if
(pageNum
-
currentPage
>=
10
)
{
document.write('
<
a href
=
"
'+strURL+'?page='+(currentPage+10)+'
"
title
=
"
下十页
"
><
font face
=
webdings
>
8
</
font
></
a
>
');
}
if
(currentPage
!=
pageNum)
{
document.write('
<
a href
=
"
'+strURL+'?page='+pageNum+'
"
title
=
"
尾页
"
><
font face
=
webdings
>
:
</
font
></
a
>
');
}
else
{
document.write('
<
Font face
=
webdings color
=
"
'+fontcolor+'
"
>
:
</
font
>
');
}
document.write(' 转到:
<
input type
=
text size
=
3
maxlength
=
10
value
=
"
'+currentPage+'
"
name
=
Page
><
input type
=
submit value
=
Go name
=
submit
>
');
//
按钮好像不行,需要完善
document.write('
</
div
></
td
></
tr
>
');
document.write('
</
form
></
table
>
');
</
script
>
public
string
strURL
=
"WebForm1
.aspx
"
;
public
int
recordNum
=
1000
;
public
int
perPageNum
=
20
;
public
int
pageIndex;
public
string
tableWidth
=
"
100%
"
;
public
string
fontcolor
=
"
red
"
;
private
void
Page_Load(
object
sender, System.EventArgs e)
{
//
在此处放置用户代码以初始化页面
pageIndex
=
System.Convert.ToInt32(Request.QueryString[
"
page
"
]);
}
查看全文
相关阅读:
数据准备2 数据清洗
数据准备1 数据导入、导出
数据分析基本流程 Python基本数据类型 Python各种括号的使用方式
fineBI 学习成果展示1
未确认融资收益的计算
合同现金流量
公允价值持续计算的金额
发放股票股利
权益法未实现内部交易损益的调整
营业外收入入不入损益
原文地址:https://www.cnblogs.com/xiaodi/p/123140.html
最新文章
REST API规范
Jeecg代码搬砖圣地番外篇(左右树布局) Ztree
VPS 如何登陆 kiwivm 面板和安装/重装系统
PHP扩展--Suhosin保护PHP应用系统使用
使用php -i或者phpinfo()查看php安装、配置信息
禁用eval函数
104种木马清理方法
护卫神云查杀可以清理网页木马
Fastjson 简明教程
wireshark怎么抓包、wireshark抓包详细图文教程
热门文章
Wireshark网络封包分析软件
Splunk SPL 关键字 函数 示例 (施工中。。。)
python List 和Numpy array 区别
python strip() 和split()
python 转义符
Python3自定义json逐层解析器代码
Python基础学习之布尔表达式
Pyecharts地图显示不完成问题解决方案
Python selenium模拟手动操作实现无人值守刷积分功能
数据准备3 数据统计
Copyright © 2011-2022 走看看