asp分页显示问题!请帮忙下,谢谢!
分不是太多!希望大家帮下忙,谢谢!如何在下面这段代码添加分页显示?<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional/...
分不是太多!希望大家帮下忙,谢谢!
如何在下面这段代码添加分页显示?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<head>
<title>数据查询页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="gb2312" />
</head>
<body bgcolor="#000000">
<p align="center"><font color="red"><b><span lang="zh-cn">
<font size="6" face="华文隶书">数据记录系统</font></span></b></font></p>
<!-- #include file="conn.asp" -->
<% Set rs = server.CreateObject("ADODB.Recordset")
sql="select * from add_T order by id desc"
rs.Open sql,conn,1,1
if not rs.eof then
do while not rs.eof
%>
<table width="735" border="1" cellpadding="0" cellspacing="0">
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#999999">
<p align="center">
<font color="#FFFFFF">[<%=rs("id") %>]</font></p></td>
<td width="106" valign="top" bgcolor="#999999"><p><font color="#FFFFFF">昵称:</font><%=rs("T1") %></p></td>
<td width="354" valign="top" bgcolor="#999999"><p><font color="#FFFFFF">主题:</font><%=rs("T2") %></p></td>
<td width="52" valign="top" bgcolor="#999999"><font color="#FFFFFF">分类:</font><%=rs("T3") %></td>
<td width="144" valign="top" bgcolor="#999999"><p><span lang="zh-cn"></span><%=rs("T5") %></p></td>
</tr>
<tr>
<td width="67" height="105" valign="top" bgcolor="#CCCCCC"><p align="center"> </p>
<p align="center"><font color="#FFFFFF">内</font></p>
<p align="center"><font color="#FFFFFF">容</font></p></td>
<td colspan="5" valign="top" bgcolor="#FAEDFA"><p><%=rs("T4") %></p></td>
</tr>
</table>
<br>
<%
rs.movenext
Loop
end if
rs.close
Set rs = Nothing
%>
<br>
<p align="center"><font color="#FF0000"><span lang="zh-cn">[<a href="add.asp" style="text-decoration: none"><font color="#FF0000">点击此处添加新数据</font></a>]</span></font></p>
</body>
</html> 展开
如何在下面这段代码添加分页显示?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="gb2312">
<head>
<title>数据查询页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="Content-Language" content="gb2312" />
</head>
<body bgcolor="#000000">
<p align="center"><font color="red"><b><span lang="zh-cn">
<font size="6" face="华文隶书">数据记录系统</font></span></b></font></p>
<!-- #include file="conn.asp" -->
<% Set rs = server.CreateObject("ADODB.Recordset")
sql="select * from add_T order by id desc"
rs.Open sql,conn,1,1
if not rs.eof then
do while not rs.eof
%>
<table width="735" border="1" cellpadding="0" cellspacing="0">
<tr>
<td height="20" colspan="2" valign="top" bgcolor="#999999">
<p align="center">
<font color="#FFFFFF">[<%=rs("id") %>]</font></p></td>
<td width="106" valign="top" bgcolor="#999999"><p><font color="#FFFFFF">昵称:</font><%=rs("T1") %></p></td>
<td width="354" valign="top" bgcolor="#999999"><p><font color="#FFFFFF">主题:</font><%=rs("T2") %></p></td>
<td width="52" valign="top" bgcolor="#999999"><font color="#FFFFFF">分类:</font><%=rs("T3") %></td>
<td width="144" valign="top" bgcolor="#999999"><p><span lang="zh-cn"></span><%=rs("T5") %></p></td>
</tr>
<tr>
<td width="67" height="105" valign="top" bgcolor="#CCCCCC"><p align="center"> </p>
<p align="center"><font color="#FFFFFF">内</font></p>
<p align="center"><font color="#FFFFFF">容</font></p></td>
<td colspan="5" valign="top" bgcolor="#FAEDFA"><p><%=rs("T4") %></p></td>
</tr>
</table>
<br>
<%
rs.movenext
Loop
end if
rs.close
Set rs = Nothing
%>
<br>
<p align="center"><font color="#FF0000"><span lang="zh-cn">[<a href="add.asp" style="text-decoration: none"><font color="#FF0000">点击此处添加新数据</font></a>]</span></font></p>
</body>
</html> 展开
2个回答
2008-01-28
展开全部
若数据库查衫雀询页为search.asp
<!--#include file="conn.asp"-->
<% Set rs = server.CreateObject("ADODB.Recordset")
sql="select * from add_T order by id desc"
rs.Open sql,conn,1,1
if request("page")="" then
page=1
else
page=cint(request("page"))
end if
rs.pagesize=9
if page=0 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.absolutepage=page if not rs.eof then
do while not rs.eof
%>
'在需要显示或慎早分页的地方,载入如下内容
<%
if page=1 then
response.write"[首页]"
end if
if page<>1 then
response.write"<a href=search.asp?page=1>[首页]</a>"
response.write"<a href=search.asp?page="孝漏&(page-1)&">[上一页]</a>"
end if
if page<>rs.pagecount then
response.write"<a href=search.asp?page="&(page+1)&">[下一页]</a>"
response.write"<a href=search.asp?page="&rs.pagecount&">[尾页]</a>"
end if
if page=rs.pagecount then
response.write"[尾页]"
end if
%>
祝你测试成功!
<!--#include file="conn.asp"-->
<% Set rs = server.CreateObject("ADODB.Recordset")
sql="select * from add_T order by id desc"
rs.Open sql,conn,1,1
if request("page")="" then
page=1
else
page=cint(request("page"))
end if
rs.pagesize=9
if page=0 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.absolutepage=page if not rs.eof then
do while not rs.eof
%>
'在需要显示或慎早分页的地方,载入如下内容
<%
if page=1 then
response.write"[首页]"
end if
if page<>1 then
response.write"<a href=search.asp?page=1>[首页]</a>"
response.write"<a href=search.asp?page="孝漏&(page-1)&">[上一页]</a>"
end if
if page<>rs.pagecount then
response.write"<a href=search.asp?page="&(page+1)&">[下一页]</a>"
response.write"<a href=search.asp?page="&rs.pagecount&">[尾页]</a>"
end if
if page=rs.pagecount then
response.write"[尾页]"
end if
%>
祝你测试成功!
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个分页程序弄懂了档乎,asp分页行雹悉肆衡就差不多了.
http://www.blueidea.com/tech/program/2007/4884.asp
http://www.blueidea.com/tech/program/2007/4884.asp
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询