.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Create Menu With MultiLevel SubMenu

Posted By:      Posted Date: September 25, 2010    Points: 0   Category :ASP.Net


i want to Create MultiLevel subMenu With this code


[ToolboxData("<{0}:Menubar runat=server>/{0}:Menubar>")] 
    public class Menubar : WebControl, IPostBackEventHandler 
        private List<MenuItem> _menuItems = new List<MenuItem>(); 
        public List<MenuItem> MenuItems 
                return _menuItems; 
    [ParseChildren(true, "MenuItems")] 
    public class MenuItem 
        private string _clientClick; 
        private List<MenuItem> _menuItems = new List<MenuItem>(); 
        public string Title { get; set; } 
        public string Href { get; set; } 
        public string Id { get; set; } 
        public List<MenuItem> MenuItems 
            get { return _menuItems; } 
            set { _menuItems = value; } 


View Complete Post

More Related Resource Links

asp:Menu submenu hover/expansion + HTTPS = Security Information Popup

Hello,I have a an asp:Menu with a datasource and the page is being accessed by https. If I hover over one of the menu items that has a subitem I get this popup.Here is my code,//asp <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="UI_Common_Test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Menu ID="Menu1" runat="server" DataSourceID="dsSiteMap" Orientation="Vertical" StaticDisplayLevels="2"> <DataBindings> <asp:MenuItemBinding DataMember="SiteMapNode" TextField="Title" /> </DataBindings> </asp:Menu> <asp:SiteMapDataSource ID="dsSiteMap" runat="server" SiteMapProvider="Public" /> </div> </form> </body> </html> //cs using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;

Easiest way to build XML based Menu with Submenu

Hello guys, I need to develop an easy and quickly to build menu structure based on xml. The menu needs to have a "Main" menu at top of the screen and a submenu at the left of the screen. Excactly like this: http://www.enexis.nl/site/over_enexis/ Can someone explain to me where i need to get started and wich control i should use?   Thanks alot! cheers,   Rob 

Top navigation menu having submenu in Team site in MOSS2007

Hi, In MOSS2007, Collaboration portal site is showing sub menu on onmouseover of top navigation menu, but it's not showing in case of Team Site template. I would like to know how to achieve this. I tried to activate publishing feature on team site, but doesn't work.

Collect Menu/Submenu/Popupmenu items

Dear Sir, I am using VS2005 and SQL Server2000 I have a project where lot of Menu/Submenu/Popupmenu items. Now I want to have all Menu/Submenu/Popupmenu items in a list box of the project. I want to do this for create user access control to my project. so that selective group can access selected feature and Menu/Submenu/Popupmenu items. How can I do this ?????? / or is there any other way to control this access????

configure distribution wizard does not appear on SSMS menu when trying to create new publication



Server A SQL 2005 sp2 Standard Ed. (9.00.3042.00)

Server B SQL 2005 sp2 Standard Ed. (9.00.3068.00)

A replication was setup on these two server a while back by someone else. Server A is the publisher and Server B is the distributor and subscriber. The replication was not working and was told it have never worked.

I was requested to rebuild the replication with local distributor, ie, moving distributor from Server B to Server A.


1. deleted the subscriber from Server B using SSMS.

2. deleted the publication from Server A using SSMS.

3. dropped the distributor using the following script on Server B

                         EXEC sp_dropdistributor @no_checks= 1

I noticed distribution database was gone from Server B. Both publication and subscription were disappeared on SSMS from respective server.


When I tried to create new publication, the "Configure Distribution Wizard" did not appeared as I expected, and the creation failed eventually with the following error.


Creating Publication

- Creating Publication 'Areporting' (Error)

How to create sub-menu in Global-Navigation ?

i want to create sub-menu for my sharepoint site like :

MainMenu > SubMenu > LinkSample1 .... LinkSamplen

assumming we have two Heading (MainMenu and SubMenu) and multiple link (like LinkSample1). i want place SubMenu underneath of MainMenu to accomplish this, but Headings can not place underneath of another Heading.
can anybody help me to workaround this problem ?
this is my Signature

I am unable to create dynamic menu from database


Hi Expert,

I am unable to create dynamic menu from database. I have made two tables for this work.

First table is Menu which stores menu id and its relevant name.
MId Text
1 File
2 Edit
3 View

Second table is subMenu which stores submenus which will be linked to the menu table with menu id.

SId Text MID
1 New 1
2 Open 1
3 Save 1
4 Cut 2
5 Copy 2

the menu should be created dynamically from the database, each menu should be displayed in single row

when we click on a menu the submenus are displayed in rows that in expand & contrast form

how to design & develope this page

submenu of main menu should come in the left side of everypage


I am using asp.net Menu control with sitemap datasource. There is one Web.sitemap in the folder where links are saved in such a manner

<siteMapNode url="~/MainMenu.aspx" title="Software Development Solutions" description="Software Development Solutions" >

      <siteMapNode url="~/submenu.aspx" title="CRM Software Application Development" description="CRM Software Application Development" />

     <siteMapNode url="~/submenu.aspx" title="CRM Software Application Development" description="CRM Software Application Development" />
<siteMapNode url="~/submenu.aspx" title="CRM Software Application Development" description="CRM Software Application Development" />


One asp.net page as i m using asp.net menu control. i want when MainMenu is clicked all the sub links of that menu should be come in the left side of the page.

transparent border around a submenu level in asp menu control..


i know this must be simple but not sure of how to get this done.

i need a border that is transparent around a level of submenu for a asp menu control(not around each of the sub menu item) similar to this.

and also the inside menu should have two layers of submenu if it is too long..

How can i do this.. Its really urgent..

How to create a webpart page with a site menu on the left?



This might be another novice question but i really googled and searched this site and didnt find any answers (even though topics close to this are discussed, this one isnt).

Scenario: I have a webpart i wrote that shows people who has birthday and provides sorting tools (in exact month/ exact day/ name contains string). This webpart has to be displayed as the page's content (in the center, its ~900px wide). This page must have the site menu on the left as well so users can navigate freely.

I tried to create a new webpart page in MOSS and successfully placed the webpart there, but the page wont have the left site menu.

I need that left menu!

I tried creating a web page from a template with a strip (sorry cant find better word to explain that) on the left but that strip only allows to add more webparts, and doesnt allow to show the menu there.

How do i show the website menu (the one with links to Tasks, Lists, Users etc, the one that always shows itself on the /sites/sitename/ page and when viewing Lists) on my web part page?

Or do i have to go other way, meaning, not by using a web part page, but with some other way, like create an aspx page or something?

Please help.

create more than one menu server control on the same page



i tried to add 2 menu server control on the same page but it was positioned one below the other instead of next to each other...

each of the menu will have several child nodes but it will be display like a drop down list

CarMakers  |  CarModels  |  RegistrationNumber

Citroen             C3                          XPTO  

Renault            Clio                         ABCD

This is how i want the menu to look like

but I only managed to add them like this:







can someone give me some hint?

Create Tab through Datalist Menu



I used datalist to create Menu.I want to show my Menu Items in separate tabs,for example when I click on A item in menu,I want A tab opens,and when I click on B item in menu B tab opens and also A tab remains open,and when I click on C item on menu C tab opens,and A tab  & B tab also remain open, how should I write this code? here is my code:


//Default.aspx :

<script type="text/javascript">
         function OnChanged(sender, args) 
    <style type="text/css">
            width: 100%;
    <form id="form1" runat="server">
       <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" RenderMode="Block" >
        <table id="table1" class="style1"  >
                    align="right" colspan="

ASP.NET Menu with jQuery Superfish

Choosing the right type of menu for a website is not easy at all. The ASP.NET Menu Control is definitely NOT a good starting point due to the horrendous markup it renders, nor is it good for SEO because of the Markup/Content ratio, neither can it be easily styled.

How to create 3 tier application using LINQ

As you know that in 3 tier architecture there are three layers

User interface layer. (Is our Form in Windows application and .aspx page in Web application)
Data Access layer. (Which provides interface between Business logic layer and Database)
Business Logic layer.(Which stores your application logic)

Create ToolTip for GridView Header

The following allows you to add a tooltip to the header links of your GridView, a feature that is lacking.

Create And Run Excel Macro At Runtime in C#

You've been tasked with writing a Windows Form application using the .NET Framework that interacts with Microsoft Excel. If you are new to working with Excel in .NET and are having trouble learning how to format certain cells or cell ranges, then this little tip will come in handy. Rather than scour the internet hoping to find the correct set of constants or method syntax for formatting your spreadsheet, use the built in tools in Excel to write the familiar VBA code for you. Then, you can paste the VBA code generated by Excel into the sample C# code below and run it dynamically at runtime.

Create and Use a Typed DataSet by Using Visual C# .NET

This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend