Solved

asp TreeView Menu

Posted on 2010-08-20
2
396 Views
Last Modified: 2012-05-10
Hey can any one give me css or javascript to make my asp TreeView Menu look cool, i am populating the Treeview menu from the database so the menu not static?

sum mouse over or something that makes it look gud, or maybe a slide menu in asp but its populating from the database. i am using C# code to populate it.
0
Comment
Question by:JCWEBHOST
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
greatsubash earned 500 total points
ID: 33482700
0
 
LVL 4

Expert Comment

by:elliottbenzle
ID: 33484565
I was trying to do something similar, if you want to use custom images try using this:

http://www.dynamicdrive.com/dynamicindex1/navigate1.htm

You will have to dynamically create your tree like this (in asp classic but you can use C#)::


<%
' This subroutine is run when cycling through all the categories then it lists every item in each category
Sub varnode()

catvar = (rscategories.Fields.Item("id").Value)

' create recordset of all content within a particular category
Set rsvideo_cmd = Server.CreateObject ("ADODB.Command")
rsvideo_cmd.ActiveConnection = MM_OnDemand_STRING
rsvideo_cmd.CommandText = "SELECT * FROM content WHERE category=" & catvar
rsvideo_cmd.Prepared = true

Set rsvideo = rsvideo_cmd.Execute

Dim extvar

Do While Not rsvideo.Eof
extvar = rsvideo.Fields.Item("extension").Value

' begin the link
response.write ("<li>")
response.write ("<div class=list_elements>")

'create a link to the emailgrabber page with ampersand friendly URL variables

        ampersand_title = rsvideo.Fields.Item("title").Value
        ampersand_friendly_link = rsvideo.Fields.Item("link").Value
        ampersand_friendly_email = email_cookie
        ampersand_friendly_title = Replace(ampersand_title, "&", "%26")
        ampersand_friendly_link = Replace(ampersand_friendly_link, "&", "%26")
        ampersand_friendly_email = Replace(ampersand_friendly_email, "&", "%26")

response.write "<a href=""../storeemail.asp?newemail=" & ampersand_friendly_email & "&vidtitle=" & ampersand_friendly_title & "&auto=" & ampersand_friendly_link & """>"
response.write (ampersand_title)
response.write "</a>"


' display an image based on the file type
If (extvar = "SWF") then
response.write ("&nbsp;<img src=""../images/flash_sm.gif"">")
ElseIf (extvar = "PDF") then
response.write ("&nbsp;<img src=""../images/pdf_logo.gif"">")
ElseIf (extvar = "FLV") then
response.write ("&nbsp;<img src=""../images/movie_logo.jpg"">")
ElseIf (extvar = "JPG") then
response.write ("&nbsp;<img src=""../images/jpg_logo.jpg"">")
ElseIf (extvar = "PEG") then
response.write ("&nbsp;<img src=""../images/jpg_logo.jpg"">")
ElseIf (extvar = "MP3") then
response.write ("&nbsp;<img src=""../images/audio_logo.gif"">")
ElseIf (extvar = "GIF") then
response.write ("&nbsp;<img src=""../images/jpg_logo.jpg"">")
End if
response.write ("</div>")

' display the items description
response.write ("<div class=""description_format"">&nbsp;&nbsp;&nbsp;&nbsp;")
response.write (rsvideo.Fields.Item("item_description").Value)
response.write ("</div>")
response.write ("</li>")
rsvideo.MoveNext()
Loop

End Sub

rsvideo_numRows = 0
%>



<div class="computer"><img src="../images/computer.jpg"></div>
                <div class="TOD_title"><span class="style1">Browse Training on Demand</span></div>
                        <!-- the treemenu works using javascript, CSS and an unordered list -->
                <ul id="treemenu1" class="treeview">
                  <%
While ((Repeat1__numRows <> 0) AND (NOT rscategories.EOF))
%>
    <li>
      <!-- display the category and run the subroutine varnode, which displays all content within that category -->
      <%=(rscategories.Fields.Item("title").Value)%>
      <ul>
        <% Call varnode() %>
      </ul>
    </li>
    <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rscategories.MoveNext()
Wend
%>
</ul>

<!-- Start create expandable tree menu  -->
            <script type="text/javascript">
            ddtreemenu.createTree("treemenu1", true, 5)
            </script>
<!-- End create expandable tree menu  -->
0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Use Mid in Html 6 35
Load XML element 3 43
Disable the weekends on datepicker control 6 51
Unprotect Visio drawing page in C# 4 18
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question