Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

Dynamic Menu

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
aroraamit81@gmail.com - 17 Feb 2006 07:07 GMT
Is there any way by which I can create a dynamic database driven Menu
using ASP.NET/C#......

Thanks
Amit Arora
Edwin Knoppert - 17 Feb 2006 08:54 GMT
About every control can be populated from code like from the page_load.

> Is there any way by which I can create a dynamic database driven Menu
> using ASP.NET/C#......
>
> Thanks
> Amit Arora
Kris - 17 Feb 2006 09:50 GMT
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
aroraamit81@gmail.com - 17 Feb 2006 11:50 GMT
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
Kris - 17 Feb 2006 12:21 GMT
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
Edwin Knoppert - 17 Feb 2006 13:53 GMT
On this site:

http://www.hellobasic.com/dotnet/imgmap1/default.aspx

I used the *ordinary* asp:Menu (for *this* specific example you'll need
MSIE, flaw in Opera).

It shows: File, Edit and Help with menus.

> Thanks Mate.....
> But i guess u took me wrong...
[quoted text clipped - 5 lines]
> Thanks,
> Amit Arora
DWS - 17 Feb 2006 16:46 GMT
Horizontal with asp.net menu control you have to create seperate menus for
each column similar to how Kris built his but going across.

> On this site:
>
[quoted text clipped - 14 lines]
> > Thanks,
> > Amit Arora

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.