我爱Aspx >> C#.Net >> 模仿PHP写的ASP分页 _ASP技巧
<%
' 分页程序
' total_records 总记录数
' everypage_records 每页显示条数
' current_page 当前页数
' url 要传递的url,这里可以含有要传递的变量,比如 "list.asp?" 或者"list.asp?keyword=key&"
' 程序调用比较简单,不过还是比PHP的麻烦,继续努力中
sub show_page(total_records,everypage_records,current_page,url)
if IsNumeric (total_records) then
total_records=Int(total_records)
else
total_records=0
end if
if IsNumeric (everypage_records) then
everypage_records=Int(everypage_records)
if everypage_records<=0 then
everypage_records=10
end if
else
everypage_records=10
end if
if IsNumeric (current_page) then
current_page=Int(current_page)
else
current_page=1
end if
'取总页数,即最后一页
if total_records mod everypage_records=0 then
last_page=Int(total_records/everypage_records)
else
last_page=Int(total_records/everypage_records)+1
end if
'判断 current_page 是否符合标准,并附值给page
if current_page>=last_page then
page=last_page
elseif current_page<=1 then
page=1
else
page=current_page
end if
'上一页
if page<=0 then
prepg=0
else
prepg=page-1
end if
'下一页
if page=last_page then
nextpg=0
else
nextpg=page+1
end if
'本页开始记录
firstcount=prepg*everypage_records
Ҷƪл˵?
ASP.NET程序中用Repeater实现分页..[04-28]
DataGrid同时具有分页和排序功能..[04-28]
用PreRender解决DataGrid分页最后..[04-28]
Asp.net url分页的用户控件 _ASP..[04-28]
ASP+FSO+框架实现ASP生成htm并分..[04-28]
一种比较方便的ASP分页程序_ASP技..[04-28]
Asp用于分页的两个函数_ASP技巧[04-28]
在ASP中轻松实现记录集分页显示_..[04-28]
asp+oracle分页程序类(XDOWNPAG..[04-28]
flash和asp分页的一点心得_ASP技..[04-28]
ASP.NET程序中用Repeater实现分页..[04-28]
DataGrid同时具有分页和排序功能..[04-28]
PHP应用分页显示制作详细讲解_PH..[04-28]
如何在SqlServer与oracel中进行分..[04-28]
用PreRender解决DataGrid分页最后..[04-28]
Asp.net url分页的用户控件 _ASP..[04-28]
关于SQL Server SQL语句查询分页..[04-28]
ASP+FSO+框架实现ASP生成htm并分..[04-28]
一种比较方便的ASP分页程序_ASP技..[04-28]
PHP中模板分页的处理_PHP技巧[04-28]