Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I was trying to get the drop down list items on MVC 5 Layout. below is my code. Here I am not getting any sub menu items of contact. please let me know where i did mistake. Thank you in advance. :)


HTML
<div class="navbar-collapse collapse">                 
                    <ul class="nav navbar-nav">
                        <!-- Left Menu Items -->                  
                      
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                        <li>@Html.ActionLink("About", "About", "Home")</li>
                        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Contact<b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">Sub menu 1</a></li>
                            <li><a href="#">Sub menu 2</a></li>
                            <li><a href="#">Sub menu 3</a></li>
                        </ul>
                        </li>
                    </ul>
</div>





What I have tried:

below is my code to get Sub menu items of contact. Please let me know if you need more details about this.

Thanks in Advance.
Posted
Updated 30-Mar-16 1:52am
Comments
F-ES Sitecore 30-Mar-16 5:58am    
You're going to have to explain what you want a bit better. What do you mean by "get" them? In a controller? JavaScript?
Member 12224368 30-Mar-16 7:20am    
through bootstrap. As per above code I have to get drop down list items.. but here I am not getting anything. please see the above code and let me know if I missed anything there.

Thank you very much in Advance.
Karthik_Mahalingam 30-Mar-16 6:46am    
what is the exact issue ?
Member 12224368 30-Mar-16 7:16am    
I was trying to add drop down list items with the above code, but I am not getting any values over there. if I click on contact it should show values what i have gave but here nothing is happening...:(
Karthik_Mahalingam 30-Mar-16 7:31am    
post your entire html page code. i think you are missing some references..

1 solution

Please add bootstrap.js reference to your code.

cdn link
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
 
Share this answer
 

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