100分,急救,好怪的分页程序
点‘下一页’http://localhost/hongli/Class.asp?PageNo=2
老是显示:
"无相关文章分类!"
"请按这儿返回"
这是什么原因呀,好怪! 老是不能显示下一页的内容,但地址栏那显示的的路径确是对的
<!--#include file="../hongli/inc/conn.asp"-->
<%
class_id=request("class_id")
if class_id="" then
response.write("<br>"&"<p>")
Response.Write "<center>无相关文章分类!</center>"
response.write "<br>"
response.write "<center><a href=./index.asp>请按这儿返回</a></center>"
Response.End
else%>
<!--#include file="./public/class.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>魔法小丫头</title>
<link href="index.css" rel="stylesheet" type="text/css">
</head>
<body background="image/background.gif" topmargin="0" marginheight="0">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#999999">
<tr>
<td><table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="image/logo.jpg" width="600" height="80"></td>
</tr>
</table>
<table width="600" height="19" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="19" background="image/a1.jpg">
<a href="index.asp" > 首页</a>
<%
dim rs
set rs=server.createobject("adodb.recordset")
rs.open "select * from class ",conn,1,1
do while not rs.eof
%>
<a href="./class.asp?class_id=<%=rs("class_id")%>"><%=rs("class_name")%></a>
<%rs.movenext
loop
rs.close
%></td>
</tr>
</table></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666">
<tr>
<td>
<table width="100%" height="35" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="./image/txt_css.gif" class="main"> 当前位置->><a href="index.asp">首页</a>->> <a href="./class.asp?class_id=<%=tclass(0)%>"><%=tclass(1)%></a>
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="89%"><div align="center"></div></td>
<td width="11%"> </td>
</tr>
</table>
<table width="600" height="284" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="181" valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#f0f0f0">
<tr>
<td height="27" background="image/title_blue.gif" class="main"> 本站分栏</td>
</tr>
<tr>
<td> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td> <%set rs=conn.execute("SELECT * FROM nclass where class_id="&tclass(0))
if rs.bof and rs.eof then
response.write "近期无更新分类"
else
do while not rs.eof
%><a href="./nclass.asp?nclass_id=<%=rs("nclass_id")%>"><%=rs("nclass_name")%></a><br>
<%
rs.movenext
loop
end if
rs.close
%></td>
</tr>
</table></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#f0f0f0">
<tr>
<td height="27" background="image/title_11212.gif" class="main"> 友情链接</td>
</tr>
<tr>
<td> <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table></td>
<td width="12"> </td>
<td width="407" valign="top"> <table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="2%" background="image/title2.gif"> </td>
<td width="95%" background="image/title2_11212.gif">[<%=tclass(1)%>]</td>
<td width="3%" background="image/title2_2.gif"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="100%" height="24" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="2%" background="image/title2.gif"> </td>
<td width="95%" background="image/title2_11212.gif"> </td>
<td width="3%" background="image/title2_2.gif"> </td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> <%
set rs1=Server.CreateObject("Adodb.Recordset")
sql= "SELECT * From nclass where class_id="&class_id
rs1.open sql,conn,1,1
set rs=Server.CreateObject("Adodb.Recordset")
sql= "SELECT * From news where nclass_id in ("&rs1("nclass_id")&") ORDER BY news_id DESC"
rs.open sql,conn,1,1
Dim TotalPage '总页数
Dim PageNo '当前显示的是第几页
Dim RecordCount '总记录条数
If RS.RecordCount=0 then
response.write "<P><center><font color=red>对不起,没有下级目录</font></center></P>"
response.end
else
RS.PageSize = 5
Totalpage=INT(RS.recordcount / rs.pagesize * -1)*-1 '计算可显示页面的总数
PageNo = Request.QueryString ("PageNo")
'直接输入页数跳转;
If Request.Form("PageNo")<>"" Then PageNo = Request.Form("PageNo")
'如果没有选择第几页,则默认显示第一页;
If PageNo = "" then PageNo = 1
Rs.AbsolutePage = PageNo
End If
'获取当前文件名,使得每次翻页都在当前页面进行;
Dim fileName,postion
fileName = Request.ServerVariables("script_name")
postion = InstrRev(fileName,"/")+1
'取得当前的文件名称,使翻页的链接指向当前文件;
fileName = Mid(fileName,postion)
Dim RowCount
RowCount = 5 '每页显示的记录条数
%>
<%
if rs.bof and rs.eof then
response.write "近期无更新文章"
else
Do while Not Rs.eof and RowCount>0
response.write "<a href='./type.asp?news_id="&rs("news_id")
response.write "' target='_blank'>"&rs("news_title")
response.write "</a><br>"
RowCount = RowCount - 1
Rs.MoveNext
Loop
end if
%></td>
</tr>
<tr>
<td><!--#include file="./public/search_page.asp"--></td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
</table>
<p class="main"> </p>
</body>
</html>
<%end if%>