Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:33

ASP Database Driven Menu and alt_url


Poster: steveclements
Dated: Thursday April 15 2004 - 14:15:51 BST

I am struggling to adapt some code to allow the parent menu to have a link as well as submenus. Looking though the forums I have found the alt_url entry but cannot get the menu to work. The code (found on the this forum) is below, I have added the code (in red) which should work but doesn't!!

Can anybody help with where I'm going wrong?

--------Start of Code ----------

<%
dim oConnect, oMenuRoot, oSub
Set oConnect = Server.CreateObject("ADODB.Connection")
oConnect.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("\milonic\monmenu\db.mdb") & ";"
set oMenuRoot = oConnect.execute("selectTOCroot")
set oMenuSub = oConnect.execute("selectTOCsub")
'ROOT MENU
do until oMenuRoot.eof
response.write ",""" & oMenuRoot("label") & ""","""
if oMenuRoot("sub") then
response.write "show-menu=" & oMenuRoot("id") & ", """& oMenuRoot("link") & """
else
response.write oMenuRoot("link")
end if
response.write """,,"""",1" & vbcrlf
oMenuRoot.movenext
loop
set oMenuRoot = nothing
'SUB MENUS
do until oMenuSub.eof
if intOldTree<>oMenuSub("parent") then
blnNewTree=true
response.write "])" & vbcrlf
else
blnNewTree=false
end if
if blnNewTree then
response.write "addmenu(menu=[""" & oMenuSub("parent") & """," & vbcrlf & ",,120,1,"""",style1,,""left"",effect,,,,,,,,,,,," & vbcrlf
end if
response.write ",""" & oMenuSub("label") & ""","""
if oMenuSub("sub") then
response.write "show-menu=" & oMenuSub("id")
else
response.write oMenuSub("link")
end if
response.write """,,,1" & vbcrlf
intOldTree=oMenuSub("parent")
oMenuSub.movenext
loop
response.write "])" & vbcrlf
set oMenuSub = nothing
%>