小弟的整站全在这儿了!!!!

jzzlpat 2003-10-15 04:59:54
www.ascatv.com.cn/zl/baile.rar

这里面的翻页问题一直没有解决。

希望大虾们给我解决一下。不盛感激。
...全文
58 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
blueice2002 2003-10-16
  • 打赏
  • 举报
回复
<%
i=i+1
if i >= MaxPerpage then exit do
rs.movenext
loop
end if
%>

</table>
</TD></TR>
<TR bgColor=#e1f0ff>
<TD class=main1 width="667" height="27" bordercolordark="#808000" bgcolor="#F3F3F3">

</TD></TR>
<TR bgColor=#e1f0ff>
<TD class=main1 width="667" height="1" bgcolor="#F8E8A0"" background="images/bg.gif"></TD></TR></TBODY></TABLE>
<%
End sub
rs.close
%> </center>
</div>
<div align="center" style="width: 696; height: 3">
<center>
</form>
<%
'显示翻页的子程序
sub showpages()%> <table bgColor="#E4DEC70" border="0" cellPadding="0" cellSpacing="0" width="100%" >
<tr><td >
<%
response.write "<form method=Post action='t_File_list.asp'>"
%>

<table bgColor="#1f60a0" border="0" cellPadding="0" cellSpacing="0" width="100%" >
<tr>
<td bgcolor="#e1foff" class=main1>
<font color="#000000">
<p align="left">
<%
Response.write "<font color='#000000'>分页-</font>"
If currentpage > 1 Then
response.write "<a href='t_File_list.asp?&page="+cstr(1)+"'><font color='#000000'>首页</font></a><font color='#000000'><b>-</b></font>"
Response.write "<a href='t_File_list.asp?page="+Cstr(currentpage-1)+"'><font color='#000000'>前页</font></a><font color='#000000'><b>-</b></font>"
Else
Response.write "<font color='#000000'>首页-</font>"
Response.write "<font color='#000000'>前页-</font>"
End if

If currentpage < Rs.PageCount Then
Response.write "<a href='t_File_list.asp?page="+Cstr(currentPage+1)+"'><font color='#000000'>后页</font></a><font color='#000000'><b>-</b></font>"
Response.write "<a href='t_File_list.asp?page="+Cstr(Rs.PageCount)+"'><font color='#000000'>尾页</font></a>  "
Else
Response.write "<font color='#000000'>后页-</font>"
Response.write "<font color='#000000'>尾页</font>  "
End if
Response.write "<font color='#000000'>页次:</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) & "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font> "
Response.write "<font color=#ff0000>" & Cstr(MaxPerPage) & "</font>" & "<font color='#000000'>条记录/页 " & "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>条记录</font>  "

response.write "</td><td align='right'>"
response.write "<font color='#ffffff' class=main1 >转到:</font><input type='text' name='page' size=4 maxlength=4 class=smallInput value="¤tpage&"> "
response.write "<input class=buttonface type='submit' value='Go' name='cndok' style='background-color: #D4D0C8' ></span>  "
%>

</font>
</td>
</tr>
</table>
</center>
</td></tr>
</table>

</form>
<%end sub%>

</div>

</center>
</body>
</html>
blueice2002 2003-10-16
  • 打赏
  • 举报
回复
给你一个分页的程序,你自己研究吧。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
'*****************************************
'** 工 程:流媒体发布系统
'** 功 能:文件管理显示列表
'** 文 件:t_File_list.asp
'** 作 者:blueice,blueiceblue@etang.com
'** 时 间:2003-10-08
'** 输 入:
'** 输 出:
'** 最后修改时间:
'*****************************************
%>
<!--#include file="../Connections/Conn_media.asp" -->
<%
bo_Class=request("Class")
bo_name=request("name")
sql="ORDER BY FileID DESC"
if bo_class="按文件ID" then
'sql="and FileID like '%" request("name")& sql
sql="and FileID like '%"& request("name") &"%'"&sql
end if
if bo_class="按文件名" then
sql="and FileName like '%"& request("name") &"%'"&sql
end if
%>
<head>
<title>文件管理显示列表</title>

<STYLE type=text/css>.main {
FONT-SIZE: 12px
}
.main1 {
FONT-SIZE: 9pt
}
.main2 {
FONT-SIZE: 16px
}
.main3 {
FONT-SIZE: 7px
}
.main4 {
FONT-SIZE: 10px
}
A:link {
COLOR: #000000; TEXT-DECORATION: none
}
A:visited {
COLOR: #ff0000; TEXT-DECORATION: none
}
A:active {
COLOR: #ff0000; TEXT-DECORATION: none
}
A:hover {
COLOR: #ff0000; TEXT-DECORATION: underline
}
</STYLE>
</head>
<body text="#000000" topmargin="0" leftmargin="0"><center>
<table width="676">
<tr>
<td width="670">
<b><font size="2">文件管理 </font></b>
</td>
</tr>
</table>

<div align="center" style="width: 677; height: 102">

<center>
<%
dim rs,sqltext
set rs=server.createobject("adodb.recordset")
sqltext="select * from t_File where FileID>0 and stopFlag='1' "&sql
rs.open sqltext,MM_Conn_media_STRING ,1,1

dim MaxPerPage
MaxPerPage=20

'假如没有数据时
If rs.eof and rs.bof then
call showpages
response.write "<p align='center'><font color='#ff0000'>还没任何文件信息</font></p>"
response.end
End if

'取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示
dim text,checkpage
text="0123456789"
Rs.PageSize=MaxPerPage
for i=1 to len(request("page"))
checkpage=instr(1,text,mid(request("page"),i,1))
if checkpage=0 then
exit for
end if
next

If checkpage<>0 then
If NOT IsEmpty(request("page")) Then
CurrentPage=Cint(request("page"))
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount
Else
CurrentPage= 1
End If
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if
Else
CurrentPage=1
End if

call showpages
call list

'If Rs.recordcount > MaxPerPage then
call showpages
'end if

'显示帖子的子程序
Sub list()%> </center>
<form method='POST' action='t_File_list.asp'>
<center>
<TABLE cellSpacing=1 cellPadding=4 width=677 bgColor=#416327 height="96">
<TBODY>
<TR vAlign=top bgColor=#e1f0ff>
<TD class=main1 height="4" width="667" bgcolor="#E4DEC7"></TD></TR>
<TR vAlign=top bgColor=#e1f0ff>
<TD class=main1 height="18" bgcolor="#F3F3F3" width="667">
<span lang="zh-cn">文件</span>信息检索: <select name='Class' size='1' tabindex='0' style="font-size: 9pt">
<option value='按文件ID'>按文件ID</option>
<option value="按文件名">按文件名</option>
</select>
<input type='text' name='Name' size='20' onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''" style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:18px;background-color:#f3f3f3;border:1 solid black">
<input type='submit' value='查询' name='Submit' style="font-family: 新细明体, 宋体, Arial; font-size: 9pt; height:20px;background-color:#D4D0C8;" onMouseOver ="this.style.backgroundColor='#FFC864'" onMouseOut ="this.style.backgroundColor='#D4D0C8'">
<span lang="zh-cn">                                        
<font color="#000080"><a target="_self" href="t_File_add.asp">
<font color="#000080">新增文件</font></a></font></span></TD></TR>
<TR vAlign=top bgColor=#e1f0ff>
<TD class=main1 height="1" width="667">
<table border="1" cellpadding="0" cellspacing="0" width="667" bordercolorlight="#416327" bordercolordark="#e1f0ff" height="37" style="border-collapse: collapse" bordercolor="#111111">
<tr class=main1>
<td width="38" height="13"> <p align="center"><span lang="zh-cn">文件</span>ID</td>
<td width="106" height="13"> <p align="center"><span lang="zh-cn">文件名</span></td>
<td width="62" height="13">
<p align="center"><span lang="zh-cn">文件格式</span></td>
<td width="39" height="13">
<p align="center"><span lang="zh-cn">类型</span></td>
<td width="150" height="13"> <p align="center"><span lang="zh-cn">插入时间</span></td>
<td width="265" height="13"> </td>
</tr>
<%
if not rs.eof then
i=0
do while not rs.eof
%>
<tr class=main1>
<td width="38" height="23"><a href="t_File_info.asp?file_id=<%=rs("FileID")%>" target="_blank"><%=rs("FileID")%></a></td>
<td width="106" height="23"><%=rs("FileName")%> </td>
<td width="62" height="23"><%= rs("FileFormat") %> </td>
<td width="39" height="23"><%if rs("FileType")=0 then
response.write "文件"
else response.write "目录"
end if %> </td>
<td width="150" height="23"><%= rs("InsertDate") %> </td>
<td width="265" height="23">
<p align="center"><font color="#000080"><span lang="zh-cn">
<a href="t_File_save_point.asp?file_id=<%=rs("FileID")%>&file_name=<%=rs("FileName")%>"><font color="#000080">存储位置</font></a> 
<a target="_blank" href="t_File_Program.asp?file_id=<%=rs("FileID")%>"><font color="#000080">节目信息</font></a> 
<a target="_self" href="t_File_modify.asp?file_id=<%=rs("FileID")%>">
<font color="#000080">修改</font></a> 
<a target="_self" href="t_File_delcheck.asp?file_id=<%=rs("FileID")%>&file_name='<%=rs("FileName")%>'"><font color="#000080">删除</font></a>
</span></font></td>
</tr>
xupiao 2003-10-16
  • 打赏
  • 举报
回复
接分

分頁如下
<%
rs.pagesize = 10 '定義頁面大小
page = clng(request("page"))

if page < 1 then page = 1
if page > rs.pagecount then page = rs.pagecount

if page <>1 then
response.write "<a href = crm_ctr_ask_1.asp?page=1>第一頁</a>"
response.write "<a href = crm_ctr_ask_1.asp?page="& (page-1) & ">上一頁</a>"
end if
if page <> rs.pagecount then
response.write "<a href = crm_ctr_ask_1.asp?page="& (page+1) & ">下一頁</a>"
response.write "<a href = crm_ctr_ask_1.asp?page="& rs.pagecount & ">最扣一頁</a>"
end if
rs.absolutepage = page '設定絕對頁的值

for i=1 to rs.pagesize
if rs.eof then exit for
顯示記錄
rs.movenext
next
jijing_JJ_JJ 2003-10-16
  • 打赏
  • 举报
回复
★★★Super-Up
老哥,你真有黑客精神,小弟挺佩服你的★★★
zhaoliangpat 2003-10-16
  • 打赏
  • 举报
回复
dafei0320 2003-10-16
  • 打赏
  • 举报
回复
<%rs.open rs1,conn,1,2
%>
<% dim page,totle,no,n,ye,zong
zong=rs.recordcount
totle=0
n=3
pagesize=n
page=request("no")
no=rs.absolutepage
rs.movefirst
do while not rs.eof
totle=totle+1
rs.movenext
loop
ye=int(totle/n*-1)*-1
if page<=1 then
page=1
end if%>
<% rs.movefirst
rs.move((page-1)*3)
y=((page-1)*3)
%>
<center>符合要求的一共有<font size="" color="#FF0000"><%=zong%></font>条 <font size="" color="#66FFFF"><%=ye%></font>页</center>
<%while y<((page-1)*3)+3 and y<totle %>
<table border="0" width="760" bgcolor="">
<td bgcolor="#FFFFCC">
<font size="3" color="#3300FF"><b><img src="<%=rs("image")%>" alt="个性头像">留言者:<font size="4" color="#FF00CC"><%=rs("name")%></font>:于<%=rs("time")%>,<font size="4" color="#FF0000">Email:<a href="mailto:<%=rs("email")%>"></font></b><img src="pic/mail.gif" width="40" height="32" border="2" alt="信箱"></font></a> <a href="<%=rs("page")%>" target="_blank"><img src="pic/page.gif" width="40" height="32" border="0" alt=""></a>
<p><font size="4" color="#FF00CC"><%=rs("name")%></font>的留言是:<br>
<table border="2" bordercolor="#FF0066">
<tr>
<td width="750" height="80"><%=rs("word")%></td>
</tr>
</table>
</p>
</table>
<% rs.movenext
y=y+1
wend
rs.close %><br>
<% if page>1 then
response.write"<a href=dafei3.asp?no="&page-1&"><font size=3 color=#CCCC66>上一页</font></a>"
end if%>共有留言<font size="4" color="#FF0000"><%=totle%></font>条 <font size="4" color="#FF66FF"><%=ye%></font>页 当前是第<font size="4" color="#33FF33"><%=page%></font>页
<% if page<ye then
response.write"<a href=dafei3.asp?no="&page+1&"><font size=3 color=#FF00FF>下一页</font></a>"

end if%>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧