Dynamic Menu

A

aroraamit81

Is there any way by which I can create a dynamic database driven Menu
using ASP.NET/C#......

Thanks
Amit Arora
 
K

Kris

Hi Amit,

I did create a left navigation menu in my web page using below code.

While (reader.Read())
Dim navLink As New HtmlHyperLink
navLink.Text = reader.GetString("Text");
navLink.Url = reader.GetString("URL");
AddRow(navLink)
If index < (years.Count - 1) Then
AddRow(New LiteralControl("&nbsp;"))
End If
End While


Private Sub AddRow(ByRef control As Control)
Dim row As New System.Web.UI.HtmlControls.HtmlTableRow
Dim cell As New System.Web.UI.HtmlControls.HtmlTableCell

If Not control Is Nothing Then
cell.Controls.Add(control)
End If
row.Cells.Add(cell)
tblLinks.Rows.Add(row)
End Sub

Cheers,
Kris
 
A

aroraamit81

Thanks Mate.....
But i guess u took me wrong...
I mean the menu, kind of comes horizontally on which mouseover,
mouseout etc. events gets fired.
I guess u have understood my requirement.
Any suggesion???..

Thanks,
Amit Arora
 
K

Kris

Hi Amit,

Yes. You can do this very well. Create a custom control which outputs
HTML text, and add onMouseOver, onMouseOut client events to display or
hide the tables accordingly. Handle these events with the help of
Javascript and CSS.

Once I did similar kind of dynamic menu generation with the help of XML
and Vb.Net.

Cheers,
Kris
 
G

Guest

Horizontal with asp.net menu control you have to create seperate menus for
each column similar to how Kris built his but going across.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top