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
"
]);
}
查看全文
相关阅读:
sfzwapp2
linux-umount时提示device is busy时,如何查找被何进程占用?
MySQL管理_数据库启动与关闭
cache 比free 多
NFS
mysql备份多个库
liunx修改时区,UTC 修改到CST
mongodb备份恢复
嵌入式新闻早班车-第24期
【STM32H7的DSP教程】第48章 STM32H7的中值滤波器实现,适合噪声和脉冲过滤(支持逐个数据的实时滤波)
原文地址:https://www.cnblogs.com/xiaodi/p/123140.html
最新文章
容器部署Ceph集群
标准成本法
平行结转法、综合结转、分项结转
股票赚钱的方式
再订货点进行的采购业务
The 5 Best Dual-Monitor Management Apps for Windows 10
拓端tecdat|R语言空气污染数据的地理空间可视化和分析:颗粒物2.5(PM2.5)和空气质量指数(AQI)
拓端tecdat|R语言用FNN-LSTM假近邻长短期记忆人工神经网络模型进行时间序列深度学习预测4个案例
拓端tecdat|R语言贝叶斯非参数模型:密度估计、非参数化随机效应meta分析心肌梗死数据
拓端tecdat|【数据分享】学生受欢迎程度评价数据集
热门文章
拓端tecdat|R语言可视化渐近正态性、收敛性:大数定律、中心极限定理、经验累积分布函数
拓端tecdat|R语言计量经济学:工具变量法(两阶段最小二乘法2SLS)线性模型分析人均食品消费时间序列数据和回归诊断
拓端tecdat|R语言逻辑回归(对数几率回归,Logistic)分析研究生录取数据实例
拓端tecdat|R语言实现随机前沿分析SFA、数据包络分析DEA、自由处置包分析FDH和BOOTSTRAP方法
拓端tecdat|R语言广义加性模型GAMs分析温度、臭氧环境数据绘制偏回归图与偏残差图
拓端tecdat|Python中TensorFlow长短期记忆神经网络LSTM、指数移动平均法预测股票市场时间序列和可视化
Session攻击(会话劫持+固定)与防御
MIME_type对照表
docker 服务启动,重启,关闭命令
top
Copyright © 2011-2022 走看看