Bootstrap - hide  <li> based on a conditionb

VBdotnet2005
VBdotnet2005 used Ask the Experts™
on
Using Bootstrap, is there a way I can hide "Switch User" from my dropdown based on a certain condition from my vb.net code behind?

  <div class="navbar-collapse collapse">
                    <ul class="nav navbar-nav">
                        <li><a runat="server" href="~/">Home</a></li>
                        <li><a runat="server" href="~/About">About</a></li>
                        <li><a runat="server" href="~/Contact">Contact</a></li>
                        <li class="dropdown">
                            <a href="/" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span> John Doe<strong class="caret"></strong></a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="#">Switch User</a>
                                </li>
                             <li>
                                    <a href="#">Account</a>
                                </li>
                                <li>
                                    <a href="#">Billing</a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a href="#"><span class="glyphicon glyphicon-off">LogOut</span></a>

                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
How do you envision this working? When you say from VB code behind - what event will trigger this and why is it necessary to go back to code behind.

Two considerations
1. Render time - when rendering your page (server side) you either render out the <li> or don't depending on some server side code

2. Client side - based on an event or client side condition you hide the option using javascript.

Author

Commented:
ok, Thank you

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial