Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET SQL-Server
Hi There,
 

I want to built dynamic menu Vertically where clicking on menu should open up child menu and hide all other menu like
 
Menu1
Menu2
Menu3
 
when i click on Menu1 its child should open like
Menu1
ChildMenu1
ChildMenu2
ChildMenu3
Menu2
Menu3
 
Like this way. Can any one help.
 

Thanks in Advances.
Posted 25-Mar-12 22:33pm
Edited 25-Mar-12 22:43pm
v2
Comments
senguptaamlan at 26-Mar-12 3:38am
   
what U have done...and where U are facing the problem?
suhailnoorpawane at 26-Mar-12 3:42am
   
i havent done any thing want something to start from. if similar line of code i get i can make it work in mine.
 
Thanks for the reply
senguptaamlan at 26-Mar-12 3:48am
   
Please, do something after that if U face any technical issues...the any one can help you...but the technical approach should come from your side first...don't take me otherwise..its for Ur betterment...here the guys are for helping not for performing anyone's homework or project work (I may be harsh but that's the fact)
suhailnoorpawane at 26-Mar-12 3:57am
   
thanks for the advice
suhailnoorpawane at 26-Mar-12 4:05am
   
i think you got me wrong there. I know how to create menu using database(dynamically) Only thing i wanted is that the fashion in which they are display as i shown in my example. Because all i got is menu and there child some out popping in hierarchical manner which i don't want(popping). it should come inside it
 
Do reply if you got solution to this
 
Thanks for the reply
Rakesh Meel at 1-May-12 4:54am
   
Reason for my vote of 1
faltu question
nika2008 at 26-Mar-13 6:42am
   
your menu i which programming languages c# or asp.net
and if c# WPF? or somthink else
can u tell me what u work
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

5- Click on this tab and you will see a blank web page where you can drag any control from the toolbox (which is in the left side of this window)
Open Web.config file and write true in place of false, See
  <compilation debug="true">
 
6- Drag a Menu Control from the navigation control tab
 
7-Now go in solution explorer and right click on the website and choose Add new item, select XML file
now again choose Add new item, select site Map .
8- Now open XML file and type this code in this.
 
view source
print?
  <?xml version="1.0" encoding="utf-8" ?>
  <application>
 
    <setction title="Section 1" value="default.aspx">
   <subpage title ="Page 1" value="page1.aspx"/>
    <subpage title ="Page 2" value="page2.aspx"/>
    <subpage title ="Page 3" value="page3.aspx"/>
   </setction>
 
   <setction title="Section 2" value="default.aspx">
   <subpage title ="Page 1" value="page1.aspx"/>     <subpage title ="Page 2" value="page2.aspx"/>
   <subpage title ="Page 3" value="page3.aspx"/>
    </setction>
 
  </application>
 
9- Now open your site Map file and type this code in it.
 
view source
print?
  <?xml version="1.0" encoding="utf-8" ?>
  <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
 
    <siteMapNode url= "Default.aspx" title= "Section 1"  description="">
    <siteMapNode url="Page1.aspx" title="Page 1"  description="" />
    <siteMapNode url="Page2.aspx" title="Page 2"  description="" />
    <siteMapNode url="Page3.aspx" title="Page 3"  description="" />
    </siteMapNode>
  </siteMap>
 
- In Design mode select menu control and click on the arrow (seems when you move cursor on menu control)
Choose Data Source ->
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

In menu1 click_method, set ChildMenu1,ChildMenu2,ChildMenu3 visibility, others nonvisibility. that should be done.
  Permalink  
Comments
suhailnoorpawane at 26-Mar-12 3:43am
   
but how to create this vertical menu which on click of menu pushes it child between other menu
 
thanks for the reply
devpeter at 26-Mar-12 3:55am
   
In the Form1.cs[design], you can add menuStrip, you will find vertical menu.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

I believe you want something like accordion control available in ASP.NET AJAX Control toolkit.
 
Please, visit the following link for the same.
 
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Accordion/Accordion.aspx[^]
 
If this solves your requirement please, mark it as answered.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

i need dynamic menu in asp.net
any body help me
  Permalink  
Comments
ThePhantomUpvoter at 26-Mar-13 8:55am
   
This is not an answer to this over year old question. If you have your own question to ask, then post it separately.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 240
1 Kamal Rocks 184
2 PIEBALDconsult 150
3 BillWoodruff 148
4 Jochen Arndt 135
0 OriginalGriff 5,695
1 DamithSL 4,506
2 Maciej Los 4,007
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100