Solved

asp TreeView Menu

Posted on 2010-08-20
2
397 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

729 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