Solved

Active Bootstrap Items Not Highlighted

Posted on 2013-06-26
2
411 Views
Last Modified: 2013-08-22
Hi:

I've set up a Bootstrap Menu with the following code:

<div class="navbar navbar-inverse">
                <div class="navbar-inner">
                    <ul class="nav">
                        <li class="active"><a href="/Home/Index"><i class="icon-home icon-white"></i>Home</a></li>
                        <li>@Html.ActionLink("Home", "Index", "Home")</li>
                        @if (Request.IsAuthenticated)
                        {
                            <li>@Html.ActionLink("My Courses", "MyCourses", "Home")</li>
                        }
                        <li>@Html.ActionLink("FAQs", "Faqs", "Home")</li>
                    </ul>

                </div>
            </div>

Open in new window


What I'd like to do is that when a person presses on a selection other than home, that item is highlighted and home is not.

Any help in how to do this greatly appreciated.

RBS
0
Comment
Question by:RBS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
lenordiste earned 500 total points
ID: 39279649
hi,

you just need to add the "active" class whenever you want the nav link to be the active one. The only trick is to figure out how to do this dynamically. You can do so in javascript or by using code behind. I thought this solution seemed decent to do just that :-)
http://chrisondotnet.com/2012/08/setting-active-link-twitter-bootstrap-navbar-aspnet-mvc/
0
 

Author Comment

by:RBS
ID: 39279970
Worked like a charm!

Thanks,
RBS
0

Featured Post

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question