查询指定栏目的子栏目HAIRUICMS

/ / 2016-01-30   阅读:2558
2.4版本以前(含2.4):<% set ChildSortRs=server.CreateObject("adodb.recordset") ChildSortRs.open "select SortID,SortName from Cuz_NewsSort where Pa...

2.4版本以前(含2.4):

<%
set ChildSortRs=server.CreateObject("adodb.recordset")
ChildSortRs.open "select SortID,SortName from Cuz_NewsSort where ParentID=7 order by SortSeq asc,SortID asc",conn,1,1
do while not ChildSortRs.eof
%>
<li><a href="/News/List.asp?SortID=<%=ChildSortRs("SortID")%>" target="_blank"><%=ChildSortRs("SortName")%></a></li> 
<%
ChildSortRs.movenext
loop
ChildSortRs.close
set ChildSortRs=nothing
%>


2.5版本以后(含2.5):

<%
set ChildSortRs=server.CreateObject("adodb.recordset")
ChildSortRs.open "select SortID,SortName from Cuz_NewsSort where ParentID=7 and "&ItemRecT&" order by SortSeq asc,SortID asc",conn,1,1
do while not ChildSortRs.eof
%>
<li><a href="/News/List.asp?SortID=<%=ChildSortRs("SortID")%>" target="_blank"><%=ChildSortRs("SortName")%></a></li> 
<%
ChildSortRs.movenext
loop
ChildSortRs.close
set ChildSortRs=nothing
%>


说明:ParentID=0时,表示查询所有一级栏目

我要评论

昵称:
验证码:

最新评论

共0条 共0页 10条/页 首页 上一页 下一页 尾页
意见反馈