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
"
]);
}
查看全文
相关阅读:
Magento速度优化
magento-connect-manage出现404或者500内部错误的解决办法
magento -- 给后台分类管理页的分类商品加一栏商品类型
magento -- 添加新产品时状态默认为激活,库存状态默认为有库存
magento -- 如何为商品分类(category)添加自定义属性
magento -- 如何改善前台图片质量
安装Let's Encrypt SSL证书
centos版本查看
ps
设置桥接虚拟网卡
原文地址:https://www.cnblogs.com/xiaodi/p/123140.html
最新文章
获取java类中的路径
JAVA 取得当前目录的路径/Servlet/class/文件路径/web路径/url地址
java加密解密 转
java中synchronized的用法详解
ServletContextListener作用 转
ビブリア古書堂の事件手帖 4
Magento创建configurable产品的要点
magneto创建运费模板
Magento删除产品同时删除图片
MAGENTO后台订单显示产品图片的修改方法
热门文章
换个心境搞IT,在IT职场如何打拼?
js优化提升访问速度
magento提速的一些小技巧,列举manegnto网站提速的
Magneto插件整理
通过.htaccess文件让Magento加速
分享25个CSS前端网页设计常用技巧
解决CSS小于12px的文字在谷歌浏览器显示问题
使网站变成响应式的3个简单步骤
Magento给新产品页面添加分页
如何给magento的产品页面添加返回按钮
Copyright © 2011-2022 走看看