asp TreeView Menu

Posted on 2010-08-20
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.
Question by:JCWEBHOST

Accepted Solution

greatsubash earned 500 total points
ID: 33482700

Expert Comment

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

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>")

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))
      <!-- display the category and run the subroutine varnode, which displays all content within that category -->
        <% Call varnode() %>

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

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
designing in object programming 12 75
C# Comparing String Arrays. 5 39
Expression Evaluater 3 24
C# LINQ ForEach() question 6 19
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 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