Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate DHTML menu with data from database using ASP

Status
Not open for further replies.

Beat

Technical User
Aug 26, 2001
41
0
0
SE
I'm building CMS websites to allow my clients to maintain their websites themselves. I am using DWMX and ACCESS and my coding skills combined with tutorials on the Internet.

On the internet I have found a lot of really nice and usful DHTML menus that drops down or have some sort of animation in them. However, I haven't been able to figure out a way of populating these menus with data from the database.

Can it be done, and if so how?

On my sites the website user is creating pages in the database by giving them names and set the type of page. On the frontend I list the names of the pages with links to the right template, depending on type, and sending id variables to determine the sub menu and content.

Hopefully someone got any good ideas!

Thanks!
 
To populate your DHTML menu's you'll need to generate Client script code that will create your menu's when runned at client.

lets say you have this code
Code:
menu1=new DHTMLMenu("go TekTips","[URL unfurl="true"]www.tek-tips.com");[/URL]
menu2=new DHTMLMenu("go TekTips","[URL unfurl="true"]www.tek-tips.com");[/URL]
... etc

You'll need to create this code within asp
something like this

<script language=javascript>
...
<%
i=1
while not objRs.Eof
%>
menu<%=i%>=new DHTMLMenu("<%=objRs("Title")%>","<%=objRs("url")%>")
<%
 objRs.MoveNext
wend
%>

</script>

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top