Solved

asp TreeView Menu

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

759 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now