Click here to Skip to main content
15,908,675 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys,

I have a master page, where i have Menu List.

i want to keep active to the menu list which is picked to open/just open.

XML
<ul id="menu" class="collapse">
                    <li class="nav-header">Menu</li>
                    <li class="nav-divider"></li>
                    <li class="active"><a href="Dashboard.aspx"><i class="fa"></i><span class="link-title">
                        Dashboard</span> </a></li>
                    <li class=""><a href="javascript:;"><i class="fa fa-"></i>&nbsp;Chemicals <span class="fa">
                    </span></a>
                        <ul>
                            <li class=""><a href="ChemicalList.aspx?DOIF=2"><i class="fa"></i>&nbsp;Main Chemicals</a>
                            </li>
                            <li class=""><a href="ChemicalList.aspx?DOIF=1"><i class="fa"></i>&nbsp;Sub Chemicals</a>
                            </li>
                        </ul>
                    </li>
                    <li><a href="ProjectList.aspx"><i class="fa fa-"></i>&nbsp; Projects</a> <span class="fa arrow">
                    </span></li>
                    <li class=""><a href="javascript:;"><i class="fa"></i>&nbsp;Reports<span class=""></span></a>
                        <ul>
                            <li><a href="Reports.aspx"><i class="fa"></i>&nbsp; Summary</a> </li>
                            <li><a href="#" target="_blank"><i class="fa"></i>&nbsp; Amout Required</a> </li>
                        </ul>
                    </li>


Can anyone plzzz...
</ul>


help me to do this.


Thanks
Posted
Updated 7-May-14 0:50am
v2
Comments
Sunasara Imdadhusen 7-May-14 6:43am    
can you please send me code snippet for the same? because without code nobody can give you proper answer.
abdul subhan mohammed 7-May-14 6:53am    
Pragmatically how can i put <li> class as active.
Sanket Saxena 7-May-14 7:00am    
are u comfortable with jQuery to do this?
abdul subhan mohammed 13-May-14 2:49am    
sanket plzzzz check this link n help me,
http://www.codeproject.com/Questions/772471/Problem-with-the-menu-in-asp-net
Vinod Kumar 7-May-14 7:01am    
can u send me a clear code.........?

1 solution

Simple solution using jQuery:

active-class-navigation-menu

you can see the working model as below:
Working page using jQuery for active menu based on url
 
Share this answer
 
v2
Comments
abdul subhan mohammed 7-May-14 10:29am    
Actually i'm already using Bootstrap... is it possible with it...???
Sanket Saxena 7-May-14 10:36am    
Yes it is,because there is no role of any plugin. Its Simple jQuery.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900