asp分页代码分页点击不出来,急求!!!
<!--#includefile="top.asp"--><%setrs=server.CreateObject("adodb.recordset")sql="selec...
<!--#include file="top.asp"-->
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from cd where tid="&Request.QueryString("tid")
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
Dim intPage
If Request.QueryString("varPage")="" Then
intPage=1
Else
intPage=CInt(Request.QueryString("varPage"))
End If
rs.PageSize=5
rs.AbsolutePage=intPage
Response.Write "<table border='1' width='1003' align='center'><tr bgcolor='#E0E0E0'>"
Response.Write "<th>姓名</th><th>电话</th><th>物品</th> <th>添加日期</th></tr>"
Dim I
For I=1 To rs.PageSize
If rs.Eof Then Exit For
Response.Write "<tr>"
Response.Write "<td>" & rs("xm") & "</td>"
Response.Write "<td>" & rs("tel") & "</td>"
Response.Write "<td>" & rs("wp") & "</td>"
Response.Write "<td>" & rs("arttime") & "</td>"
Response.Write "</tr>"
rs.MoveNext
Next
Response.Write "</table>"
Response.Write "<p><a href='cs.asp?varPage=1'>第1页</a> "
If intPage>1 Then
Response.Write "<a href='cs.asp?varPage=" & (intPage-1) & "'>上一页</a> "
Else
Response.Write "上一页 "
End If
If intPage<rs.PageCount Then
Response.Write "<a href='cs.asp?varPage=" & (intPage+1) & "'>下一页</a> "
Else
Response.Write "下一页 "
End If
Response.Write "<a href='cs.asp?varPage=" & rs.PageCount & "'>最后页</a> "
Else
Response.Write "该记录集为空"
End If
%>
<!--#include file="bottom.asp"--> 展开
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from cd where tid="&Request.QueryString("tid")
rs.open sql,conn,1,1
if not(rs.bof and rs.eof) then
Dim intPage
If Request.QueryString("varPage")="" Then
intPage=1
Else
intPage=CInt(Request.QueryString("varPage"))
End If
rs.PageSize=5
rs.AbsolutePage=intPage
Response.Write "<table border='1' width='1003' align='center'><tr bgcolor='#E0E0E0'>"
Response.Write "<th>姓名</th><th>电话</th><th>物品</th> <th>添加日期</th></tr>"
Dim I
For I=1 To rs.PageSize
If rs.Eof Then Exit For
Response.Write "<tr>"
Response.Write "<td>" & rs("xm") & "</td>"
Response.Write "<td>" & rs("tel") & "</td>"
Response.Write "<td>" & rs("wp") & "</td>"
Response.Write "<td>" & rs("arttime") & "</td>"
Response.Write "</tr>"
rs.MoveNext
Next
Response.Write "</table>"
Response.Write "<p><a href='cs.asp?varPage=1'>第1页</a> "
If intPage>1 Then
Response.Write "<a href='cs.asp?varPage=" & (intPage-1) & "'>上一页</a> "
Else
Response.Write "上一页 "
End If
If intPage<rs.PageCount Then
Response.Write "<a href='cs.asp?varPage=" & (intPage+1) & "'>下一页</a> "
Else
Response.Write "下一页 "
End If
Response.Write "<a href='cs.asp?varPage=" & rs.PageCount & "'>最后页</a> "
Else
Response.Write "该记录集为空"
End If
%>
<!--#include file="bottom.asp"--> 展开
2个回答
展开全部
1
tid=Request.QueryString("tid")
sql="select * from cd where tid="&tid
2
分页的连接全部加上"tid="&tid,如下
Response.Write "<a href='cs.asp?varPage=" & (intPage+1) & "tid="&tid&"'>下一页</a> "
tid=Request.QueryString("tid")
sql="select * from cd where tid="&tid
2
分页的连接全部加上"tid="&tid,如下
Response.Write "<a href='cs.asp?varPage=" & (intPage+1) & "tid="&tid&"'>下一页</a> "
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询