查询指定栏目的子栏目
2016-01-30阅读:2499
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时,表示查询所有一级栏目