请教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