asp.net mvc - Bootstrap tabs in layout.cshtml - not rendering body -


i have started learning mvc bootstrap. have setup layout page following:

<ul class="nav nav-tabs">         <li class="active">@html.actionlink("home", "index", "home", null, new { @data_toggle = "tab", href = "#home" })</li>         <li>@html.actionlink("programming", "programming", "home", null, new { @data_toggle = "tab", href = "#programming" })</li>     </ul>      <div class="tab-content">         @renderbody()     </div> 

my homecontroller:

public actionresult index()     {         viewbag.message = "modify template jump-start asp.net mvc application.";          return view();     } public actionresult programming()     {         viewbag.message = "your programming tab page";          return view();     } 

my views: index.cshtml

    @{     viewbag.title = "home page"; }  <div id="home" class="tab-pane fade in active">     <h3>home</h3>     <p>this home view's index.cshtml.</p> </div> 

programming.cshtml

    @{         viewbag.title = "programming";     }     <div id="programming" class="tab-pane fade">         <h3>programming</h3>         <p>this home view's programming.cshtml</p>     </div> 

the problem having when nav bar shows up, click home , displays home or index's content in renderbody fine. when click on programming, renderbody doesn't change @ all.

could please?

thank pointers, siamak , artm.

the following modifications fixed issue:
modified actionlink

<ul class="nav nav-tabs">     <li class="active">@html.actionlink("home", "index", "home")</li>     <li>@html.actionlink("programming", "programming", "home")</li> </ul>  <div class="tab-content">     @renderbody() </div> 

removed class div in views

     @{         viewbag.title = "programming";     }     <div id="programming">         <h3>programming</h3>         <p>this home view's programming.cshtml</p>     </div> 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -