Link to home
Start Free TrialLog in
Avatar of BrianFord
BrianFordFlag for United States of America

asked on

Set active Bootstrap Tab from VB Code Behind

I'm using a Bootstrap NAV panel with NAV panes and I have a 2 part question:

1. How can I set the active tab-pane from VB code behind?

2. When my page loads, I see the 3 tabs and the 1st tab is active, but the contents of the tab are not seen until I click on the 2nd or 3rd tab??

Code is attached:
 <link href="Content/bootstrap.css" rel="stylesheet" />
    <script src="Scripts/jquery-2.1.3.js"></script>
    <script src="Scripts/bootstrap.js"></script>

    <div class="container">
        <div class="panel panel-info">
            <div class="panel-heading">
                <ul class="nav nav-tabs">
                    <li class="nav active"><a href="#A" data-toggle="tab">Tab A</a></li>
                    <li class="nav"><a href="#B" data-toggle="tab">Tab B</a></li>
                    <li class="nav"><a href="#C" data-toggle="tab">Tab C</a></li>
                </ul>
            </div>
            <div class="panel-body">
                <!-- Tab panes -->
                <div class="tab-content">
                    <div class="tab-pane fade" id="A">Content inside tab A</div>
                    <div class="tab-pane fade" id="B">Content inside tab B</div>
                    <div class="tab-pane fade" id="C">Content inside tab C</div>
                </div>
            </div>
            </div>
    </div>

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

What type of web site are you using?  The Bootstrap navbar is not an ASP.NET component, per se, but you could make one that has server-side properties, and could generate the HTML that you need.
ASKER CERTIFIED SOLUTION
Avatar of BrianFord
BrianFord
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BrianFord

ASKER

Self-solved
Avatar of Sherry Jackson
Sherry Jackson

Hello, I'm looking to do the same but I don't quite follow your solution.  Would you mind sharing all of the ASPX and the code behind?