请高手帮忙看看,急!我的新闻分了4类,当我点其中一类下一页的时候,所有的分类新闻都显出来了

weihanmingwhmwhm 2015-10-09 05:21:43

麻烦大家帮忙看看,当我点其中一类新闻上下页时,所有分类的新闻都显出来了,是怎回事

<% response.charset="utf-8" %>
<!--#include file="../Include/LanguageCh.asp" -->
<!--#include file="../Include/NoSqlHack.asp" -->
<!--#include file="../Include/Const.asp" -->
<!--#include file="../Include/ConnSiteData.asp" -->
<%
call SiteInfo()

SortID = Request.QueryString("SortID")

if SortID<>"" then
if not isInteger(SortID) then
ErrMessage = "没有指定操作参数!"
Writemsg(ErrMessage)
response.end
end if

set rs = server.createobject("adodb.recordset")
sql = "select ID,SortName"&Language&",Title"&Language&",Keywords"&Language&",Descriptions"&Language&" from YunXin_NewsSort where ViewFlag"&Language&" and ID="&SortID
rs.open sql,conn,1,1
if rs.eof and rs.bof then
ErrMessage = "参数传递错误!"
Writemsg(ErrMessage)
response.end
else
newssortname = rs("SortName"&Language)
if trim(rs("Title"&Language))<>"" then
webtitle = trim(rs("Title"&Language))
else
webtitle = newssortname
end if
if trim(rs("Keywords"&Language))<>"" then
seokeywords = trim(rs("Keywords"&Language))
else
seokeywords = newssortname
end if
if trim(rs("Descriptions"&Language))<>"" then
seodescriptions = trim(rs("Descriptions"&Language))
else
seodescriptions = newssortname
end if
end if
rs.close
set rs = nothing
else
webtitle = "新闻中心"
seokeywords = "新闻中心"
seodescriptions = "新闻中心"
end if
%>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="Copyright 2004-2020 - YunXinCMS" />
<title>活动动态</title>
<meta name="Keywords" content="<% =seokeywords %>" />
<meta name="Description" content="<% =seodescriptions %>" />
<link href="Css/Style.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="background" style="position:absolute;z-index:-1;width:100%;height:100%;top:0px;left:0px;"></div>
<table width="1260" height="800" border="0" align="center" cellpadding="0" cellspacing="0" background="../images/aboutus/aboutbg.png">
<tr>
<td><!--#include file="contacthead.asp"--></td>

</tr>
<tr>
<td ><img src="../images/hongdong.png" width="1260" height="419" /></td>
</tr>
<tr>
<td><table width="1260" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="260" height="400" align="center" valign="top" ><!--#include file="Left2.asp"--></td>
<td width="20"></td>
<td height="1100" align="center" valign="top" class="barright">
<table width="920" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:20px;">
<tr>
<td height="30" align="left" style="border-bottom:1px solid #0161B8;"><img src="Images/arrow02.gif" width="25" height="21" align="absmiddle" />您的当前位置:<a href="<% Call ChHomeUrl() %>">首页</a><%=WebLocation()%></td>
</tr>
</table>
<table width="920" border="0" cellspacing="0" cellpadding="0">
<%
set rs1 = server.createobject("adodb.recordset")
if SortID = "" then
sql = "select * from YunXin_News where ViewFlag"&Language&" order by ID desc"
else
SortPath = conn.execute("select * from YunXin_NewsSort where ViewFlag"&Language&" and ID="&SortID&"")("SortPath")
sql = "select * from YunXin_News where ViewFlag"&Language&" and Instr(SortPath,'"&SortPath&"')>0 order by ID desc"
end if
rs1.open sql,conn,1,1
'判断数据库中是否有数据信息
if rs1.eof and rs1.bof then
response.write "<tr><td width='730' align='center'><font color=""#FF0000"">暂无您要找的信息</font></td></tr>"
else
rs1.pagesize = 24
'判断页面参数传递是否正确
if not Isnumeric(request.querystring("page")) then
response.write "<tr><td width='730' align='center'><font color=""#FF0000"">页面参数传递错误</font></td></tr>"
else
page=clng(request.querystring("page"))
if page<1 then page=1
if page>rs1.pagecount then page=rs1.pagecount
rs1.AbsolutePage = page
for i=1 to rs1.pagesize
%>
<tr>
<td height="30" align="left" style="font-size:18px; border-bottom:1px dashed #cccccc;" ><img src="Images/Arrow_01.gif" width="9" height="4" align="absmiddle" />
<%
if rs1("PictureFlag") then
response.write "<font color=""#e17504"">[图]</font><a href=""NewsView.asp?ID="&rs1("ID")&""">"&rs1("NewsName"&Language)&"</a>"
else
response.write "<a href=""NewsView.asp?ID="&rs1("ID")&""">"&rs1("NewsName"&Language)&"</a>"
end if
%></td>
<td width="100" align="left" style="border-bottom:1px dashed #cccccc;"></td>
</tr>
<%
rs1.movenext
if rs1.eof then
exit For
end if
next
end if
'判断页面参数传递结束
end if
%>
</table>
<table width="920" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40" align="center"><%
if page<=1 then
%>
首页 上页
<%else%>
<a href="?page=1&SortID=<%=ID%>">首页</a> <a href="?page=<%=page-1%>&SortID=<%=ID%>">上页</a>
<%end if%>
第 <font color="#ff0000"><%=page%></font> 页
<%if page>=rs1.pagecount then%>
下页 尾页
<%else%>
<a href="?page=<%=page+1%>&SortID=<%=ID%>">下页</a> <a href="?page=<%=rs1.pagecount%>&SortID=<%=ID%>">尾页</a>
<%end if%>
共 <font color="#e17504"><%=rs1.pagecount%></font> 页(<font color="#e17504"> <%=rs1.pagesize%></font>条/页)
<%
rs1.close
set rs1=nothing
%></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<%
Function WebLocation()
if SortID = "" then
WebLocation = " > <a href='News.asp'>活动动态</a>"&vbCrLf
else
WebLocation = ""&vbCrLf
Dim rs, sql
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from YunXin_NewsSort Where ID="&SortID
rs.Open sql, conn, 1, 1
WebLocation = WebLocation&SortPathTXT("YunXin_NewsSort", rs("ID"))
rs.Close
Set rs = Nothing
end if
End Function

Function SortPathTXT(DataFrom, ID)
Dim rs, sql
Set rs = server.CreateObject("adodb.recordset")
sql = "Select * From "&DataFrom&" where ID="&ID
rs.Open sql, conn, 1, 1
If Not rs.EOF Then
'AutoLink = "/"&htmlmulu&"/"
SortPathTXT = SortPathTXT(DataFrom, rs("ParentID"))&" > <a href=""News.asp?SortID="&rs("ID")&""">"&rs("SortName"&Language)&"</a>"
End If
rs.Close
Set rs = Nothing
End Function
%>
...全文
196 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
weihanmingwhmwhm 2015-10-12
  • 打赏
  • 举报
回复
但发现末页又有问题,末首与首页,显示不正确,点末页的时候,显示全部了
  • 打赏
  • 举报
回复
<a href="?page=1&SortID=<%=ID%>">首页</a> <a href="?page=<%=page-1%>&SortID=<%=ID%>">上页</a> <%end if%> 第 <font color="#ff0000"><%=page%></font> 页 <%if page>=rs1.pagecount then%> 下页 尾页 <%else%> <a href="?page=<%=page+1%>&SortID=<%=ID%>">下页</a> <a href="?page=<%=rs1.pagecount%>&SortID=<%=ID%>">尾页</a> 你这里红色部分的变量名写错了吧,你上面SortID = Request.QueryString("SortID") 那应该红色部分是SortID吧
weihanmingwhmwhm 2015-10-10
  • 打赏
  • 举报
回复
引用 5 楼 slwsss 的回复:
<a href="?page=<%=page+1%>&SortID=<%=SortID%>">下页</a>
亲,可以了,太感谢了!
weihanmingwhmwhm 2015-10-10
  • 打赏
  • 举报
回复
引用 6 楼 chinmo 的回复:
<a href="?page=1&SortID=<%=ID%>">首页</a> <a href="?page=<%=page-1%>&SortID=<%=ID%>">上页</a> <%end if%> 第 <font color="#ff0000"><%=page%></font> 页 <%if page>=rs1.pagecount then%> 下页 尾页 <%else%> <a href="?page=<%=page+1%>&SortID=<%=ID%>">下页</a> <a href="?page=<%=rs1.pagecount%>&SortID=<%=ID%>">尾页</a> 你这里红色部分的变量名写错了吧,你上面SortID = Request.QueryString("SortID") 那应该红色部分是SortID吧
我试一下,谢谢
slwsss 2015-10-09
  • 打赏
  • 举报
回复
<a href="?page=<%=page+1%>&SortID=<%=SortID%>">下页</a>
weihanmingwhmwhm 2015-10-09
  • 打赏
  • 举报
回复
我想点每个分类上下页时,单独显示自己的分类自己的分类列表内容。现在则是所有分类内容都显在里面了
weihanmingwhmwhm 2015-10-09
  • 打赏
  • 举报
回复
引用 2 楼 slwsss 的回复:
分类ID没传吧
可能上下页那里定义错了,点上下页时,他索取不到固话的分类ID 点下一页时,浏览器地址是这样News.asp?page=2&SortID= 我在浏览器上面加一个8,显示就正常,如:News.asp?page=2&SortID=8
slwsss 2015-10-09
  • 打赏
  • 举报
回复
分类ID没传吧
weihanmingwhmwhm 2015-10-09
  • 打赏
  • 举报
回复
免费试听地址:B站搜索JeeGit观看《JeeSite4.x数据权限教程》、《JeeSite1.2.7系列基础教程》、《JeeSite4.x系列基础教程》等相关课程! 郑重声明:购课前,认真听完第一章 课程简介 建议实战人群直接听:第九章、第十章 学生人群、刚入门:全听       数据权限主要讲解内容包含第一章 课程简介31.1 课程目标31.2 适用人群31.3 课程简介31.4 环境要求31.5 课程知识点大全31.6 课程售价31.7 购课声明31.8 资源清单31.9 售后方式41.10 讲师介绍4第二章 权限基础42.1 权限模型概述4第三章 JeeSite权限管理模型123.1 JeeSite1.2.7 权限管理模型123.2 JeeSite4.x 权限管理模型123.3 JeeSite4.x权限设计的扩展13第四章 用户管理144.1 JeeSite4.x内置用户型144.1.1 用户管理思路144.1.2 网站会员、员工、单位、个人登录视图配置154.2 用户数据权限型164.3实战训练、调试、日志查看16第五章 机构管理16第六章 角色管理186.1 JeeSite4.x角色管理概述186.2 JeeSite4.x越级授权与菜单权重186.3 JeeSite4.x 越级授权可能存在的隐患极其解决方案196.4用户表如何区非管理员、系统管理员、二级管理员206.5 角色权限注意事项206.6 角色授权数据范围使用注意事项216.7 为何用户不设置员工权限无效?236.8 岗位管理与角色的岗位与角色有何区别?23第七章 二级管理员23第八章 系统管理员238.1 系统管理员238.2 总结:何时使用超级管理员、系统管理员、二级管理员?23第九章 Jeesite数据权限调用239.1 JeeSite4.x数据调用基础239.2 JeeSite4.x 实现数据列权限推荐解决方案249.3多数源模式下数据权限bug简易解决方案249.4 JeeSite4.x 自定义扩展数据权限249.5支持全球地区、全球企业、全球机构、全球部门授权24第十章 JeeSite数据权限实战2410.1 案例一2410.2 案例二2410.3 案例三2510.4 案例四2510.5 案例五25第十一章 JeeSite4.x常见问题解答251.1数据权限管理的代码会公开吗,购买了能看吗?251.2 JeeSite数据权限教程是Thinkgem录制的吗?25第十二章 参考阅读2612.1、JeeSite官方文档2712.2、美国国家标准与技术研究院2712.3、中国国家标准化管理委员会2712.4、ITSEC欧洲安全评价标准2812.5、百度学术2812.6、开源框架2912.6.1 JeeSite2912.6.2 Casbin2912.6.3 Eladmin2912.6.4 Spring-boot-demo2912.6.5 Jeeplatform3012.6.6 Pig3012.6.7 Jeecg-boot3012.6.8 Jfinal3012.6.9 Guns3112.6.10 Zheng3112.6.11 Cloud-Platform3112.7 博文资源31

28,391

社区成员

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

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