Background
In web sites there is a need to use many submenus under the Main menus due to vast categories of content, so by considering this requirement I have written this article to demonstrate how to create nested dynamic submenus using CSS which all browsers support.
Let's start by creating a website as:
- Start - All Programs - Microsoft Visual Studio 2010
- File - New Website - C# - Empty website (to avoid adding a master page)
- Give the web site a name such as NestedSubmenu or whatever you wish and specify the location
- Then right-click on Solution Explorer - Add New Item - Default.aspx page
<bodybgcolor="#c0c0c0">
<form id="form2" runat="server">
<ulid="Ul1"> // for horizontal Main Menu Tab
<li><ahref="#" title ="Homepage" class="selected">About Us</a ></li >
<li ><a href ="#" title ="About us">Authors</ a ></li > //for submenu
<li ><a href ="#" title ="Projects">Articles</a >
<ul>
<li ><a href ="#" title="Older projects">Older Articles</a > //for submenu
<ul>
<li> <a href ="#" title ="">ASP.Net </ a ></ li >// for Nested subemenu and <a> tag is used to URL address
<li> <a href ="#" title ="">Silverlight</a ></ li >
<li> <a href ="#" title ="">Ajax</a ></ li >
</ ul >
</ li >
<li> <a href ="#" title ="Active projects">New Articles</a > //for submenu
<ul>
<li> <a href ="" title ="Excel FIle">File Upload</a ></ li > // for Nested subemenu
<li> <a href ="" title ="ConvertNoToString">Convert Number</a ></li >
<li> <a href ="" title ="Stored Procedure">Stored Procedure</a ></ li >
</ ul >
</ li >
</ ul >
</ li >
<li> <a href ="#" title ="Contact">Contact Us</a ></ li >
</ul >
</form>
</body>
In the above source code the <li> tag is used to create a horizontal Main Menu and the <ul> list tag is used to create the submenu, again under the <ul> used and another <ul> tag to create a nested submenu.


Vithal WadjePosted Aug 12, 2013, 5:11 PM
thanks Raj sir
Rati RajPosted Aug 7, 2013, 8:47 AM
Thanks for such a quick solution.....
Vithal WadjePosted Nov 27, 2012, 3:25 AM
thank you johnnymward,its my pleasure
Former memberPosted Nov 27, 2012, 3:05 AM
Thank you very much dude
Vithal WadjePosted Nov 16, 2012, 10:03 PM
thank you pankaj
Pankaj TiwarieditedPosted Nov 9, 2012, 4:28 PMEdited Nov 9, 2012, 4:29 PM
Good.. Please refer this link for more details .. http://pankajtiwarii.blogspot.in/
Vithal WadjePosted Oct 31, 2012, 5:54 AM
thanks a lot Rohatash Kumar sir,i cant belive that you have read my article.. just sir i am inspired from all of you who gives the great contribution not only to C#-corner but also all new comers who struglling to settle life by getting job. again thanks
Rohatash KumarPosted Oct 31, 2012, 4:13 AM
Nice article.Vithal.. I have also bookmarked this article for future use.
Vithal WadjePosted Oct 31, 2012, 12:15 AM
its my pleasure Anil Saxena sir,thanks you
Anil SaxenaPosted Oct 30, 2012, 11:40 PM
This article helps me to create menu without any code of JavaScript..