标题:请教2级导航菜单1级排序更改后2级菜单不同步问题
取消只看楼主
kil566
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-1-15
结帖率:100%
已结贴  问题点数:20 回复次数:1 
请教2级导航菜单1级排序更改后2级菜单不同步问题
如题,在把1级菜单的排序后更改后2级菜单的内容就不同步了,例如把分类(网络营)的排序OrderID改为7后2级分类排序就不对了
程序代码:
Private Sub Ok3w_HearNav(ChannelID)
    sql="select ID,SortName,gotoURL,ParentID,SortPath from Ok3w_Class where ChannelID=1 and ParentID=0 and IsNav=1 order by OrderID"
    Rs.Open Sql,Conn,0,1
    ID = Rs("ID")
    ParentID = Rs("ParentID")
    '一级菜单
   
    Do While Not Rs.Eof
        If Rs("gotoURL") = "" Then
            gotoURL = Page_URL(ChannelID,Rs("ID"),"")
        Else
            gotoURL = Rs("gotoURL")
        End If
        Nav_SortName = Rs("SortName")
        ParentID = ParentID+ID
        Response.Write("<li class='mainlevel'><a href=""" & gotoURL & """>" & Nav_SortName & "</a>")
           '二级菜单
              
          Set rs2=server.CreateObject("adodb.recordset")
          sql="select ID,SortName,gotoURL,ParentID,SortPath from Ok3w_Class where ChannelID=1 and ParentID=" & ParentID & " and IsNav=1 order by OrderID"
          Rs2.Open Sql,Conn,0,1
             Response.Write("<ul>")
           Do While Not Rs2.Eof
             If Rs("gotoURL") = "" Then
             gotoURL = Page_URL(ChannelID,Rs2("ID"),"")
             Else
             gotoURL = Rs2("gotoURL")
             End If
             Nav_SortName = Rs2("SortName")
             Response.Write("<span class='Triangle_con'></span>")
             Response.Write("<li><a href=""" & gotoURL & """>" & Nav_SortName & "</a></li>")
           Rs2.MoveNext
           Loop
             Response.Write("</ul>")
           Rs2.Close
        

    Rs.MoveNext
    Loop
    Response.Write("</li>")
    Rs.Close

End Sub


搜索更多相关主题的帖子: color 菜单 
2013-01-15 21:28
kil566
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-1-15
得分:0 
看来是赋值的问题
          sql="select ID,SortName,gotoURL,ParentID,SortPath from Ok3w_Class where ChannelID=1 and ParentID="&rs("ID")&" and IsNav=1 order by OrderID"
      改成直接RS 就好了ParentID="&rs("ID")&"
2013-01-20 15:52



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-396711-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.061220 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved