dynamic - ASP Menu driving me insane -


I am trying to create a menu using ASP (I have not used ASP before, PHP man has made) a database.

Basically I want the HTML layout to be as follows:

  & lt; Ul & gt; & Lt; Li & gt; & Lt; Ul class = "sub-menu" & gt; & Lt; Li class = "sub-menu-li" & gt; Test & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt;  

I have root menu items around ("AD_Level") which is equal to 0 for root objects, so that inside the loop, there is nothing like the same parent ID that surrounds Side loop loop is needed if the current record is AD_Level = 0 and AD_Parent = 5 then loop around all objects with AD_Parent 5 and AD_Level! = 0 and html in the values ​​and so on and so on.

Please help! I am struggling with a new language and can not see one way to do this without losing consciousness.

Edit (Comment by OP Exclude rsAdmin.eof base structures = rsAdmin ("ad_parent" if rsAdmin ("AD_Level") = 0 then not rsAdmin2.eof if rsAdmin2 ("AD_Level" ) rsAdmin2 ("ad_parent") = base structures and rsAdmin2 ("AD_Sec_Level") => Then response.write rsAdmin ("AD_Menu") end if rsAdmin2.movenext passes 'end' # If not rsAdmin.eof then base structures = rsAdmin ("AD_parent") pass rsAdmin.movenext is my code

that

after "text" itemprop = "text">

Definitely it is a clear case for using recursive, since just providing the psuedo-code below, I can not really understand your menu structure very well with your code, so I made it directly to ASP Attempted to put in code:

with Level = 0 Display menu text for each menu item Generate call (if applicable) Call (menu item.Id) Next Function GenerateSubMenu (ID) Display menu text with parent = ID for each menu (if applicable) Generate call submenu (MenuItem.ID) Next End Function

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -